Error data using QGuiApplication::screens()
-
Hello, I have 2 screens with different resolutions. I am trying to scale my multiscreen program after disconecting and conecting the same screen again. Before disconecting, this
QList<QScreen *> pS=QGuiApplication::screens();
returns to me 2 screens with the right resolution. But after disconecting and conecting the same
QList<QScreen *> pS=QGuiApplication::screens();
it returns to me 2 screens. The first one has the right resolution but the second one returns to me the maximum resolution that the first screen has. But no the resolution of the second display.
Should I use any functions before asking for these data again?
Any idea?
Thanks -
@JonexElectronic said in Error data using QGuiApplication::screens():
But after disconecting and conecting the same
QList<QScreen *> pS=QGuiApplication::screens();
it returns to me 2 screens. The first one has the right resolution but the second one returns to me the maximum resolution that the first screen has. But no the resolution of the second display.
Should I use any functions before asking for these data again?
This sounds like a bug to me.
Does your application emit the screenRemoved() signal when you disconnect the screen? (https://doc.qt.io/qt-5/qguiapplication.html#screenRemoved ) And similarly, does it emit the screenAdded() signal when you re-connect the screen?
-
@JonexElectronic said in Error data using QGuiApplication::screens():
Yes, both signals are emited.
OK, I suggest opening a bug report at https://bugreports.qt.io/. Please describe what you told us here (including the fact that screenRemoved() gets emitted but the screens() function still returns the wrong list), and also include your Qt version and OS version.