On Monday, 2013-12-30, 01:24:51, Tom Isaacson wrote: > I've created a basic dialog in Qt Creator that has a tab widget to organise > the controls. This works fine, but I don't understand how to make it so the > controls on a particular tab belong to that tab rather than the dialog. In > Object Inspector the controls appear under the tab but when I access them > in code via "ui->" they're part of the dialog. This means every time I add > a tab the amount of code and controls in my dialog has to be extended.
The widgets are children of the respective tab page or of a container on that page. What you are seeing with ui-> is that each designer form is processed by a code generator (UIC) and it generates all the constructor and value setter calls into one setupUi() function (inside a file called ui_formname.h) If you want to have each tab page separated on the code level, simply design each page as its own form (template type Widget), implement their functionality in their respective header and source files and add them to the tab widget either by widget promotion in designer or by creating their instances in the dialog's constructor and adding them to the tab widget there. Cheers, Kevin -- Kevin Krammer | [email protected] | Software Engineer Klarälvdalens Datakonsult AB, a KDAB Group company Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322) KDAB - Qt Experts - Platform-independent software solutions
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Qt-creator mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/qt-creator
