Answer the question
In order to leave comments, you need to log in
Why doesn't QGuiApplication emit a signal?
There is a code:
#include <qapplication.h>
#include <qguiapplication.h>
#include <qscreen.h>
#include <qlist.h>
#include <qdebug.h>
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
for (;;) {
auto countMonitor = QGuiApplication::screens();
qDebug() << countMonitor.size();
}
return a.exec();
}
Answer the question
In order to leave comments, you need to log in
I checked it on my computer. Windows 10, Qt 5.15.2. Indeed, when the monitor is connected/disconnected, the signals are not called. After a cursory review of the Qt sources, I came to the conclusion that this functionality is not implemented for Windows.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question