PDA

View Full Version : full screen on specified monitor



mgb_qt
30th July 2010, 15:57
I am trying to send a QWidget full screen to a specific monitor.



QDesktopWidget *desktop = QApplication::desktop();

QRect rect = desktop>screenGeometry(screen_number);

setGeometry(rect);

setWindowState((windowState() & ~(Qt::WindowMinimized | Qt::WindowMaximized))| Qt::WindowFullScreen);



This works, but when I restore from fullScreen using showNormal() the widget is full screen size but positioned at 0,0 so there is no titlebar.
I can manually resize it but there is still no title bar until I force a resize() with the mouse.

Presumably showFullScreen() sets some previous size to restore to - that I'm not setting?

Alternatively I tried moving the widget to the position on the second display returned by screenGeometry() and then calling showFullScreen() but this maximises it on the original display.

Whats the procedure for maximising on a specific display and then returning to the previous window size/position?

MTK358
1st August 2010, 13:43
Whats the procedure for maximising on a specific display and then returning to the previous window size/position?

Why not let the user do it via the window manager, or is there some reason to do it automatically?

mgb
3rd August 2010, 18:35
Yes, there's a specific external monitor that the app has to be drawn onto.