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.
Thomas Feldman (9th May 2007)
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
I didn't try that under Qt4 so I can't tell you how fast it is. (my method).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?
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.
Bookmarks