Help - Search - Members - Calendar
Full Version: Dialog Sizing
OESF Forums > Distros, Development, and Model Specific Forums > Everything Development > Qt/Qtopia
marshmn
Hi,

In an app I'm creating I have a dialog that pops up. I'd like to have the dialog be maximised to fill the whole screen, but I can't see how I go about doing that?

I've played around with the different "sizePolicy" settings, but none of these seem to make it fill to fit the screen. I thought that perhaps setting the policy to "Expanding/Expanding" would do the trick, but it seems not.

I'm launching the dialog by doing:

CODE
UploadDialog dialog(this);
dialog.exec();


Can anyone give me an idea how I should be doing this?

Thanks,
Matt
vanstrien
I think I know what you are asking.

In the past when I have needed to do what you want I've used:
CODE
showMaximized();


See: http://doc.trolltech.com/qtopia1.7/html/qwidget.html#b6e000

Does that help?
melee
Hi,

Alternately in the dialog constructor, get the parent widgets size and resize accordingly
Allows you to make it slightly smaller than full screen (or any size you want.)

eg

DefDlg::DefDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl )
{
if ( !name )
setName( "DefDlg" );
resize(parent->width() - 50, parent->height() - 50 );
// more stuff
}

regards

Melee
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2015 Invision Power Services, Inc.