PDA

View Full Version : Questions about two measures to develop using QtDesigner



luffy27
23rd November 2006, 01:23
As we know, in the QtDesigner3.0 and later version, we can directly edit our custom slot in the .ui.h file. But I know there is another way to do the same work. We can use the uic tool to generate the .h and .cpp files from the .ui file. And then we can subclass our own class from the generated .cpp file.

Based on the description above, I have three questions:
1. Is it correct about all my description(because I'm not sure about howthe process goes.)

2. If I'm right, what is the different between these two measures? which one should we commonly use?

3. If I chose the second measure to develop(subclass my own class from the .cpp which is generated by uic),how to compile my own project now?

thanks a lot

wysota
23rd November 2006, 06:08
1. Is it correct about all my description(because I'm not sure about howthe process goes.)
It is correct for Qt3. Qt4 forces you to subclass.


2. If I'm right, what is the different between these two measures? which one should we commonly use?
Based on the fact that Qt4 no longer allows you to use Designer generated classes directly, the second approach is preferred - it's cleaner, but requires slightly more work and leaves slightly bigger memory footprint.


3. If I chose the second measure to develop(subclass my own class from the .cpp which is generated by uic),how to compile my own project now?

Exactly the same way, just add the subclass files to your project, recreate the makefile and build the project.

luffy27
23rd November 2006, 10:55
Thank you, I will try both of the two measures. And if there is any problem, I will post them on the forum to find some helps.
Thanks again.