[Qt-interest] Setting MainLayout in QDialog

Alexandre Beraud aberaud at infflux.com
Fri Apr 30 16:09:03 CEST 2010


Wait, QLayouts are not QWidgets. You can apply a layout to a widget and, 
thus, you can apply a layout to a QDialog.Use myDialog->setLayout(myLayout).

Regards,

Alex


Aaron Lewis a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
> 	How can i set an QHBoxLayout as the central item of an QDialog ?
>
> 	Often in QMainWindow , i'd morph an QHBoxLayout into a QWidget , and
> use setCentralWidget function. However it doesn't work this time.
>
> 	Sample Code:
> 		
> 		I've got a UI file ,  has an memeber called mainLayout which is a
> QHBoxLayout.
>
>
> MasterWindow::MasterWindow(QWidget *parent) :
>     QDialog(parent),
>     ui(new Ui::MasterWindow)
> {
>     ui->setupUi(this);
>     theme *th = new theme();
>     ui->mainLayout->addWidget(th);
> }
>
>
> How can i make ui->mainLayout centrally ?
>
> Appreciate any of your help ;-)
>
> Thanks in advance !
>
> - -- 
> Best Regards,
> Aaron Lewis - PGP: 0x4A6D32A0
> FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
> irc: A4r0n on freenode
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkva0ckACgkQvf41sEptMqCVzgCguzLF+1Y7Oa/l4gyWNPsn8wqg
> eCQAn1bSgtpVyCE6tzeRuSXXqdpYW0c5
> =k29Z
> -----END PGP SIGNATURE-----
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>   


-- 
Alexandre BERAUD
Ingénieur Développement

Infflux - Informatique & Flux
Tel: 01 49 57 92 00 - Fax : 01 49 57 92 01
Mail: aberaud at infflux.com
Visitez notre site :  www.infflux.com




More information about the Qt-interest-old mailing list