PDA

View Full Version : How to load a .h or .cpp file in designer?



srohit24
18th February 2009, 13:19
I learned that i can get .h file if i compile the .ui file.

Consider that i make some changes to that .h file and i want to get it back into the designer to make further changes, how can that be done??

I get only a .h file, how can i create a application out of the .h file? I mean i need to have a exe which can load, once i double click it.

thanks in advance.

Boron
18th February 2009, 13:32
You could subclass the generated class from the h-file. Probably implemement additional functionality, add a main() function, compile and link the whole bunch of files and be happy :).

And I think you should carefully read the Qt tutorial: http://doc.trolltech.com/4.4/tutorials.html

And last, read this: http://doc.trolltech.com/4.4/designer-using-a-component.html
This is part of the Qt Designer manual.
I think "The Single Inheritance Approach" is the most commonly used approach to use "designed" components in an application.

spirit
18th February 2009, 13:33
it can not be done. changing generated h-file bad idea, because this file is generated automatically, so you should make changes in ui or in that cpp file which contains widget for which ui will be set up.