View Full Version : multi screen
Thomas Feldman
9th May 2007, 10:28
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
high_flyer
9th May 2007, 13:16
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 (http://www.qtcentre.org/forum/f-qt-programming-2/t-any-fast-way10ms-to-display-640480-qimage-on-qgraphicsscene-6929.html)
Thomas Feldman
9th May 2007, 14:23
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?
high_flyer
9th May 2007, 14:32
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.
Thomas Feldman
9th May 2007, 16:21
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
high_flyer
9th May 2007, 16:41
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().
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.