Results 1 to 3 of 3

Thread: Desktop size.

  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Desktop size.

    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.

  2. #2
    Join Date
    Jan 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Desktop size.

    Take a look at the QDesktopWidget class (which you can get an instance with QApplication::desktop()).

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Desktop size.

    Quote Originally Posted by hickscorp View Post
    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.
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    hickscorp (11th May 2007)

Similar Threads

  1. Restrict size of QLineEdit
    By bruccutler in forum Newbie
    Replies: 2
    Last Post: 19th March 2007, 17:31
  2. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 09:16
  3. Replies: 3
    Last Post: 30th January 2007, 08:35
  4. Replies: 1
    Last Post: 24th October 2006, 17:40
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 23:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.