PDA

View Full Version : Doubt about creating GUI



sudheer168
6th October 2010, 06:05
Hi everybody ,

I am working with QT4.4.0 . Now I am starting a new project which should be compile in both windows , Linux and Mac . Most of the cases I have seen that GUI was developed through code not with the designer . Now I am planing to create total GUI of my application using designer in windows Platform . Will it be any problem if I compile the same application in both Linux and Mac. I am very much confused why most of the people create GUI through code.
So please help me to clear my confusion .

Regards,
Sudheer.

foxyproxy
6th October 2010, 07:02
You can use both Qt Designer or writing code to develop GUI; maybe if you are a beginner you can try using Qt Designer because it is usually fast and intuitive.
Qt is a cross-platform framework and that means when you write C++ code by using Qt it is compatible on Windows, Linux and Mac. That is ok when you don't write platfotm-dipendent code.

sudheer168
6th October 2010, 07:32
Hi ,
Thanks for your reply . Please make me clear about that can I create an application GUI with designer and make compile the same in windows ,Linux and Mac with out any problem.


Regards,
Sudheer K

ChrisW67
6th October 2010, 08:08
You build the UI with Designer which produces a source file with the UI extension. This file is listed in the FORMS section of your PRO file. It is ultimately compiled by a program called uic to produce a C++ source file called ui_whatever.h that is included in your user interface class implementation, e.g. mainwindow.cpp contains
#include "ui_mainwindow.h"which was built from mainwindow.ui.

You don't need to worry about how this works if you let qmake handle it for you. Copy the source to the target platform, run qmake and make. It works happily across Linux, Windows and Mac.

sudheer168
25th October 2010, 08:31
Hi ,
Thanks for your reply , I got confused with your answer which is shown below.


It is ultimately compiled by a program called uic to produce a C++ source file called ui_whatever.h


After creating .ui file you asked me to list in forms section of PRO file , after that what all I have to do to get the ui_whatever.h . Actually you told told compile for that what all I have to do.
Please help me .



Regards,
Sudheer.

genjix
25th October 2010, 18:34
It's better to make GUI's using code than the designer because designers GUIs suck :p GUIs designed in code are nicer IMO and it's easier to do things like dynamic interfaces .etc