PDA

View Full Version : How to detect multi screen in QT?



Kevin Hoang
19th March 2010, 10:31
Which classes help me detect multi screen and show separate widgets on each available screen?

Help me!

zgulser
19th March 2010, 10:45
What do you mean by screen? Separate .exe files?

aamer4yu
19th March 2010, 11:00
QDesktopWidget::numScreens

QDesktopWidget::screenGeometry

use the above functions to set geometry of the widget, QWidget::setGeometry

Kevin Hoang
19th March 2010, 11:14
What do you mean by screen? Separate .exe files?

No, one or more exe file, rather than is separate tasks on each screen.

Kevin Hoang
26th March 2010, 19:14
Thanks to aamer4yu!

I have new question need help: How to detect monitor type?

squidge
26th March 2010, 19:39
Monitor type? What do you mean?

Kevin Hoang
26th March 2010, 19:54
I'm sorry, I have a mistake.

I want to detect video display interfaces, such as: DVI, Analog, HDMI. Give me a way to do with QT?

wysota
26th March 2010, 20:32
There is no way to do it with Qt. I'd even say you have to interface directly with the hardware driver to be able to query for such information. In other words you need to use native API.

squidge
26th March 2010, 23:38
I want to detect video display interfaces, such as: DVI, Analog, HDMI. Give me a way to do with QT?You need to read the EDID from the monitor. There is no platform independant way of doing that.

On windows, the EDID may be stored in the registry. Monitors are enumerated as the child devices of display adapters. You can find information by reading the 'Monitor' class GUID tree {4d36e96e-e325-11ce-bfc1-08002be10318}, reading the monitor id, and then looking up that id in the DISPLAY section of the Enum section of the current control set.

For example, I can find the EDID for my primary monitor at HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\DISPL AY\VSCE41B\5&8a4b4de&0&11335587&05&00\Device Parameters, and by looking at byte 20, I can see it's digital.

Don't depend on this however - the data may not be available for all monitors - Windows will only give you exactly what it retrieves from the monitor itself.

Furthermore, both HDMI and DVI are digital, so it's a lot more difficult (or impossible? I don't know) to tell them apart.

wysota
27th March 2010, 00:02
Furthermore EDID will only be reported for adapters that actually have monitors connected to them.