PDA

View Full Version : Desktop size.



hickscorp
11th May 2007, 02:24
Hello people,

I dont have any problem, so if i dont get any answers it's ok :)
I have implemented a few classes from QDialogs, which save their own positions before closing (And restaure their positions at re-opening of the application). But, let's suppose that those dialogs were on the 2nd screen of a dual-screen setup, and the user has unplugged the 2nd screen. The question is, is there a way to know the size of the desktop for multi-screens? Or, is there a collision method which allows me to know if the window is off-screen?

Thanks for your time ;)
Pierre.

K39
11th May 2007, 02:51
Take a look at the QDesktopWidget (http://doc.trolltech.com/lastest/qdesktopwidget.html) class (which you can get an instance with QApplication::desktop() (http://doc.trolltech.com/lastest/qapplication.html#desktop)).

jpn
11th May 2007, 07:14
I have implemented a few classes from QDialogs, which save their own positions before closing (And restaure their positions at re-opening of the application). But, let's suppose that those dialogs were on the 2nd screen of a dual-screen setup, and the user has unplugged the 2nd screen. The question is, is there a way to know the size of the desktop for multi-screens? Or, is there a collision method which allows me to know if the window is off-screen?
QWidget::saveGeometry() and QWidget::restoreGeometry() take this possibility into account out of the box.