[Qt-interest] About the QTDesigner ui
Tony Rietwyk
tony.rietwyk at rightsoft.com.au
Sun May 24 03:54:29 CEST 2009
Kosta wrote:
Hi,
I was wondering about the ui variable generated by the Designer. I have been
thinking, what if your UI is big. In the Designer, it's separated in tabs
for example, but at the end the only thing you do is... just create a widget
and call the setupUI method to put ALL into this widget.
What do you think about it ?
I'm working on a project right now, and I am thinking how to implement all
in object-oriented way, while my whole ui is actually in my MainWindow
widget and ui variable.
Also it seems I can only auto-connect slots in the widget to which setupUI
is called. Maby I should put all the methods in this class ?
In almost all examples QT Designer is not used and the objects are quite
clear and consistent. And now everything is in one place. :)
Or I'm missing something, I'm new to QT and C++ and I am a little bit
confused now. :)
You do not need to define everything in the one Designer form - especially
tabs. You can copy the contents of each tab into separate ui files based on
QWidget, then create and add them at run-time - either all in the
constructor (after ui.setupUi), or even as required. You may need to
adjustSize on the main Window, after creating your tab widgets.
In the generated UI files, you will see a call to connectSlotsByName - this
is what does the auto-connect. You can call it too - but you cannot call it
twice, because Qt is not smart enough to have a public method to ask whether
the connect has already been done!
It's a shame there aren't more examples that use designer.
Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090524/b7d6036e/attachment.html
More information about the Qt-interest-old
mailing list