[Qt-creator] Why is UI always created as a pointer and not overloaded?

Ernst Huber swmail01 at systest.ch
Wed Feb 11 19:36:46 CET 2009


Andre Poenitz schrieb:
> ext Matthias Pospiech wrote:
>   
>> This is what Qt-Creator creates automatically:
>> [...]
>> //------------------------------------------
>>
>> Whereas I am used to this code:
>>
>>
>> //------------------------------------------
>>
>> class MainWindow : public QMainWindow, protected Ui_MainWindow
>>     
>
> That the uic generated header to be #included in your header
> while for the setup used by Creator a declaration is sufficient.
>
> Using the declaration-only variant reduces #include dependencies
> and therefore scales better to larger projects.
>
> Andre'
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-creator
>
>
>   
What gets created is the so called "The Single Inheritance Approach
" as described in the Qt documentation.

You can read it here:

http://doc.trolltech.com/4.4/designer-using-a-component.html

I actually feel very comfortable with this approach but one could think 
of an option in the Qt Creator class wizard where users could choose how 
the UI classes should be generated.

Regards
Ernst






More information about the Qt-creator-old mailing list