PDA

View Full Version : i want to use QtDesigner file(.ui file) in My Existing Project??



pavanbarot
3rd August 2010, 11:07
Sir,
one more Question..
I m using Qt4.6.2... i want to use QtDesigner file(.ui file) in My Existing Project.... how i got .h(header file) and .cpp(Class File) from .ui files....
uic(command) give on Header File... if uic work with my qt this version then how it's done?? give me steps??

Thanks Sir.

Tavit
3rd August 2010, 12:05
Hi pavan,
In Qt4.6.2 there is no way to getting the .h file and .cpp files.. So please do this manner copy that file name and add the new GUI User Class with same name.that time you will get .h , .cpp and .ui files. Now you just select all the previous Ui File content and copy into new .UI file that time you got code every thing.(I think that is the solution for that) using uic compiler you won't get the .h and .cpp files.. So that as my knowldge I preffered this way..


Thanks& regards,
Tavit.

Zlatomir
3rd August 2010, 13:40
The class.cpp and class.h are your code it's not the uic duty to provide those.
uic will provide only one header, after that you need to learn how to use that header.

So just add the .ui file to the project and code a class (with private *ui, or with multiple inheritance) it's not that hard (you can use the method Tavit said, but anyway you will need to add functions/functionality to that class so that copy-paste thing only saves you about 10 lines of code)

Here (http://doc.trolltech.com/4.6/designer-using-a-ui-file.html) is the documentation on how to use/add ui with your code.

squidge
3rd August 2010, 14:12
Also, please do not use visitor messages to ask questions. They will be ignored.