[Qt-interest] [SOLVED] Re: Setting MainLayout in QDialog

Aaron Lewis aaron.lewis1989 at gmail.com
Sat May 1 01:10:07 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/30/2010 10:09 PM, Alexandre Beraud wrote:
> 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).
> 

Thanks Alex , that works for me. ;-)

Code:

	setLayout(ui->mainLayout);

> Regards,
> 
> Alex
> 
> 
> Aaron Lewis a écrit :
> 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 !
> 
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
>>

- -- 
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/

iEYEARECAAYFAkvbY08ACgkQvf41sEptMqD9MACgvsTR66re4X2j3MuwAHxQjctc
g2kAnj1dgn8pwJ7cpO6CWqKV0LgN1Pi+
=+lYR
-----END PGP SIGNATURE-----



More information about the Qt-interest-old mailing list