Results 1 to 6 of 6

Thread: multi screen

  1. #1
    Join Date
    May 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Talking multi screen

    Hello,

    i'm programming an application under Qt4/windows dedicated to multi screen video. I would like to render the content of a first widget in full screen mode to screen 1 and to render the content of the second widget in full screen mode to screen 2.

    Does anyone knows how to do this with lowest CPU usage?

    Thanks!

    Thomas

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

    Default Re: multi screen

    Have a look at QDesktopWidget in order to target various screens.
    Does anyone knows how to do this with lowest CPU usage?
    Have a look here
    ==========================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.

  3. #3
    Join Date
    May 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multi screen

    Quote Originally Posted by high_flyer View Post
    Have a look at QDesktopWidget in order to target various screens.
    The trouble is that, as far as i understand, QDesktopWidget is an information class that enable to "retrieve" information about screens but doesn't allow to assign a particular widget to a particular screen..is that true?

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

    Default Re: multi screen

    Well, with QDesktopWidget you can get a pointer to the deskotop which is on the desired screen.
    And you can use that pointer as a parent for the widget you want to place on that screen.
    NOTE: on a virtual desktop it might not be possible to distiguish between physical screens shared by the same desktop, all though the docs say it should be.
    I had that problem not long ago - but then you can use QWidget::move() to place your widget on the right physical screen.
    ==========================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. The following user says thank you to high_flyer for this useful post:

    Thomas Feldman (9th May 2007)

  6. #5
    Join Date
    May 2007
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multi screen

    Thanks for this answer. I will indeed use QApplication::desktop()->screen(0 or 1) as the parent widget.

    May I ask you another question. I planned to use a QLabel for displaying pixmaps (each 40 ms). From your experience, is it slower than your method, ie using QImage and QBrush-> fillRect? Either, did you try the drawPixmap function of Qpainter?

    Thanks
    Thomas

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

    Default Re: multi screen

    May I ask you another question. I planned to use a QLabel for displaying pixmaps (each 40 ms). From your experience, is it slower than your method, ie using QImage and QBrush-> fillRect? Either, did you try the drawPixmap function of Qpainter?
    I didn't try that under Qt4 so I can't tell you how fast it is. (my method).
    Or if it even works.
    To what you had in mind:
    In case you are getting a buffer from external source - like a camera, you will have to convert from QImager to QPixmap - and that is slow.
    Your aim should be to feed your buffer as directly as you can to the paintEvent().
    ==========================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.

Similar Threads

  1. regarding a touch screen driver for qt-embedded
    By sar_van81 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd March 2007, 11:23
  2. QTimer based Splash Screen
    By bpetty in forum Newbie
    Replies: 6
    Last Post: 15th December 2006, 01:51
  3. Replies: 3
    Last Post: 8th December 2006, 19:51
  4. hiding mouse on second screen
    By safknw in forum KDE Forum
    Replies: 1
    Last Post: 24th November 2006, 12:09
  5. Problem with screen update...
    By mysearch05 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2006, 19:24

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.