Results 1 to 6 of 6

Thread: Large desktop for Multiple Display Monitors

  1. #1
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Large desktop for Multiple Display Monitors

    There are two ways that multiple monitors may be used: as one large desktop or as a number of independent displays. When used as one large desktop, the monitors create more screen space for applications.

    So how can i detect that the desktop is whether make up of multiple monitors or just one monitor? QApplication::desktop()->screenCount() just return 1 for both case.

    Is Qt support that? or have to use native API?

    Thanks in advance!

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Large desktop for Multiple Display Monitors

    What is the result of QDesktopWidget::isVirtualDesktop()?
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Dec 2009
    Location
    Shenzhen,China
    Posts
    21
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Large desktop for Multiple Display Monitors

    QDesktopWidget::isVirtualDesktop() returns true, so????

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,716
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Large desktop for Multiple Display Monitors

    In a virtual desktop you have only one screen, that starches over multiple hardware monitors.
    virtualDesktop : const bool

    This property holds if the system manages the available screens in a virtual desktop.

    For virtual desktops, screen() will always return the same widget. The size of the virtual desktop is the size of this desktop widget.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Mar 2010
    Posts
    86
    Thanks
    11
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Large desktop for Multiple Display Monitors

    try this
    Qt Code:
    1. QDesktopWidget * desktop = QApplication::desktop();
    2. originalPixmap = QPixmap::grabWindow(desktop->winId(), desktop->x(), desktop->y(), desktop->width(), desktop->height());
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Large desktop for Multiple Display Monitors

    Or check width to height ratio.
    If it's huge - you have a multiple screen desktop (or veeeery odd screen)

Similar Threads

  1. Replies: 2
    Last Post: 19th November 2008, 09:01
  2. Display only PNG image on desktop
    By durbrak in forum Qt Programming
    Replies: 32
    Last Post: 15th March 2008, 21:55
  3. Replies: 2
    Last Post: 30th August 2006, 10:09
  4. QGLWidget with multiple monitors
    By Rayven in forum Qt Programming
    Replies: 3
    Last Post: 4th August 2006, 10:28
  5. Solaris/SPARC with Multi-Monitors
    By Rayven in forum Qt Programming
    Replies: 2
    Last Post: 27th July 2006, 03:51

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.