Author Topic: Dialog Sizing  (Read 3718 times)

marshmn

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://www.mattmarsh.net/
Dialog Sizing
« on: August 04, 2005, 04:45:51 am »
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: [Select]
UploadDialog dialog(this);
dialog.exec();

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

Thanks,
Matt
SL-C860 - Cacko 1.22a

http://www.mattmarsh.net/

vanstrien

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://www.vanstrien.net
Dialog Sizing
« Reply #1 on: August 05, 2005, 10:05:36 pm »
I think I know what you are asking.

In the past when I have needed to do what you want I've used:
Code: [Select]
showMaximized();
See: http://doc.trolltech.com/qtopia1.7/html/qwidget.html#b6e000

Does that help?
C860 Cacko ROM | 5500 tkcROM
256MB SD | 128MB SD
512MB CF | 256MB CF
D-Link DWL 660 WiFi| Linksys WCF12 WiFi
Socket Bluetooth | Socket Ethernet

melee

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • http://
Dialog Sizing
« Reply #2 on: August 06, 2005, 12:27:29 pm »
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
C860 - with Sharp ROM
1GB SD and 2 GB & 256MB CF
WiFi, Bluetooth and Sharp CF camera cards
Ubuntu 6.06
(WinXP if I really have to)