Saturday, April 26, 2008

GUI design with qt4 - 1 (Basics and layouts)


Qt4-designer is a great cross platform application used for GUI design of applicatons, It has inbuilt programs like qmake to generate the c++ code of the GUI application, which you can modify to say what the application to do, when clicked on a button or so . U can get it on ubuntu by apt-get
"sudo apt-get install qt4-designer qt4-dev-tools qt4-doc"
The above command installs qt4 with documentation on ur system. Now when u open q
t4-designer from Applications->Programming->Qt4 Designer u will see the that all the windows scattered around the desktop, If u want to keep the application intact.
  1. close the new form window.
  2. go to Edit->preferences->(in User interface mode change option from Multiple Top-Level windows to Docked).
You can see the interface changes to a single window. U can choose which ever is convinient for u (i prefer to work in Docked mode).

Now we create a new layout by selecting New form from main menu (file->newform). which gives an option in selecting the default design

After selecting the design, u can just drag and drop widgets (combobox,text edit , line edit, etc....... which u see in the left column)on to the main GUI window. just play around with them. If at anytime u want to see how your application looks in the end choose form->preview from the toolbar

U might have observed that the widgets doesn't resize when you resize the main window; that's where LAYOUTS comes into picture. In the tool bar you will be able to see these buttons (horizontal, vertial , horizontal with seperation , vertical wiith seperation and grid). Select the widgets that you want to align and click on these buttons to allign them according to your requirement (so simple right :D). U will be seeing a red box surrrounding it (just to indicated that they are in layout) . Now if u want the widgets to get resized when u resize the main window, select anywhere on the main window and apply a layout. You can remove a layout at anytime by selecting the layout and clicking on the 6th button in the above pic.

Play around with the layouts and the widgets to get the final form of your application's
gui. Keep a track of the property editor where u can edit the properties of widgets, layouts, spacing, etc .......
  • Property editor : u can edit the properties of the widgets like size behaviour name etc .....
  • signal/slot editor : control the inner connections between the widgets
  • Object inspector : shows the list of the widgets placed and how they are linked
  • Widget box : contains all the widgets to be placed,
  • Resource editor : All the icons data are store in seperate file than in the ui file, add icons to ur resource file.

Ubuntu 8.04 codename "Hardy Heron" released

As promised ubuntu team released its long term supported "Hardy Heron" on 24th april 2008 , which has a life span of 3 years unlike gutsy which is of 18 months. There are no major changes from gutsy, however there are still some minor upgrades :
  • Kernel 2.6.24-16
  • Gnome 2.22.1
  • Transmission replaces the default gnome-bittorrent.
  • Vinagre(remote desktop viewer) replaces the default vncviewer.
  • Brasero cd/dvd burning application replacing the Serpentine audio cd burning utility.
  • GVFS is included in nautilus replacing GnomeVFS
  • Firefox-3 beta 5 replacing firefox-2
  • Policykit utility added.
  • Pulse audio by default.
  • Upgrade in world clock applet, now can display time and weather at multiple locations.
  • The old boring wallpaper and login screen are now replaced :D; but the brown and orange color scheme remains the same. And there are few minor changes in the look and feel.
Coming to repositories there are lots and lots of stuff added, applications like piklab, cntlm,etc... are now officially maintained.
For the first time sound in vmware is woking ..... kudoos to it :P
Caution: Don't upgrade from 7.10 to 8.04 , either do a fresh install of 8.04 or stick with 7.10. I don't know the reasons but i obeserve slow in the system when i upgraded, so i did a fresh install of 8.04 .
Ubuntu 8.04 is a great release and lives up to the expectations. So far i faced no problems. ubuntu will be continuing its 6 months releases; the next one is gonna be 8.10 (Intrepid Ibex)
scheduled in sometime october.