Results 1 to 3 of 3

Thread: Desktop Dual Screen in Ubuntu 10.04, get screen width and height not coherent.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Desktop Dual Screen in Ubuntu 10.04, get screen width and height not coherent.

    This works for me and I'm using dual monitors.

    Qt Code:
    1. #include <QtCore/QtCore>
    2. #include <QtGui/QtGui>
    3.  
    4. int main(int argc, char** argv)
    5. {
    6. new QApplication(argc, argv);
    7.  
    8. QDesktopWidget desktop;
    9. for (int i = 0; i < desktop.screenCount(); ++i) {
    10. qDebug() << "Width: " << desktop.screenGeometry(i).width();
    11. qDebug() << "Height: " << desktop.screenGeometry(i).height();
    12. }
    13.  
    14. return QApplication::exec();
    15. }
    To copy to clipboard, switch view to plain text mode 
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  2. #2
    Join Date
    Jun 2010
    Posts
    36
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Desktop Dual Screen in Ubuntu 10.04, get screen width and height not coherent.

    Right on the spot. Thanks.

Similar Threads

  1. Replies: 3
    Last Post: 13th May 2010, 08:20
  2. Replies: 2
    Last Post: 25th February 2010, 10:28
  3. QLayout: different SizeConstraints for width and height?
    By PhilippB in forum Qt Programming
    Replies: 0
    Last Post: 23rd February 2009, 16:33
  4. Pixmap height / width without loading it
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2007, 07:10
  5. width and height of QTabWidget
    By chikkireddi in forum Qt Programming
    Replies: 6
    Last Post: 29th October 2007, 13:53

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.