PDA

View Full Version : Frustrated trying to get maximized window.



Doug Broadwell
5th February 2009, 02:52
Windows, Qt 4.2.3.

I've researched through the threads, I've tried to use showFullScreen(), showMaximized(), and setWindowState( windowState() ^ Qt:: WindowFullScreen) - both in my main() and in my QMainWindow() derived object constructor.

I get a 'Flash' of full screen and then back to the small window. How does one get an application to start up full screen?

Thanks

aamer4yu
5th February 2009, 04:15
There must be some prob with the code, check again.
Also might be that some other application is intervening.

Lykurg
5th February 2009, 18:36
Hi,

I had this problem time ago but I don't know what it caused :( It had to do with my used widgets and their arrangement in layouts. After rearranging in a different layout (with the same appearance) the showMaximized worked.

So if your layout is not to complicated try to rearrange. May this help, or not :o


Lykurg

dougbroadwell
5th February 2009, 23:08
I found the problem. My code was:

mw = new QMainWindow;
sa = new QScrollArea;
sa->setWidget( mw );
sa->show();
mw->showMaximized();


When I maximized the QScrollArea instead of the QMainWindow all was well with the world; also putting the show() after the showMaximized() resulted in cleaner screen painting.

mw = new QMainWindow;
sa = new QScrollArea;
sa->setWidget( mw );
sa->showMaximized();
sa->show();


Thanks for the help.

aamer4yu
6th February 2009, 06:06
Why would you want to put QMainWindow inside a QScrollArea :confused:
May be theres some better way ;)