Tuesday, April 5, 2011

Qt Designer, Add Toolbar

Taken from the official website itfself:
Qt is a cross-platform application and UI framework. Using Qt, you can write web-enabled applications once and deploy them across desktop, mobile and embedded operating systems without rewriting the source code.

Totally awesome! After working a bit with GTK, now it's time for Qt. Of course, the first thing that I work is with the 'Designer'. Now, I really love designing with this tool. Took a bit to adjust with the way to design the UI with it, specially after working with Glade GTK UI Designer. Once, I got used to it, it just felt more natural designing with Designer.

I would like to share how to add toolbar in the Designer. It is not so obvious how to add toolbar, so I hope it is useful.

The way to add a toolbar is by right-clicking on a form, main_window, or what have you, and choose 'add toolbar.'

Right this point, you will not get a functional toolbar, since you only have the container, without any buttons.

Next step is to add resources to the project, using 'Resource Browser'. If you don't have it, you can activate it from the menu bar, under view menu. Then from resource browser, click on the 'Gear' button to open 'Edit Resources' dialog.

Once, you have it opened, add resource file, by click the 'New Resource File' button. Then, click add prefix, and after that add the image files for toolbar icons, by clicking 'Add Files' button.

Now, to add the buttons in the toolbar, simply drag and drop from 'Resource Browser' onto the toolbar, and that is it.

No comments:

Post a Comment