#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 (;;) {
QGuiApplication::processEvents();
auto countMonitor = QGuiApplication::screens();
qDebug() << countMonitor.size();
}
return a.exec();
}
#include <qapplication.h>
#include <qguiapplication.h>
#include <qscreen.h>
#include <qlist.h>
#include <qdebug.h>
#include "Monitor.h"
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
int countMonitor = Monitor::monitorCount();
auto pushReaction = new Monitor();
QObject::connect(QGuiApplication::instance(), SIGNAL(screenRemoved(QScreen*)), pushReaction, SLOT(monitorRemoved(QScreen*)));
QObject::connect(QGuiApplication::instance(), SIGNAL(screenAdded(QScreen*)), pushReaction, SLOT(monitorAdded(QScreen*)));
for (;;) {
QGuiApplication::processEvents();
auto countMonitor = QGuiApplication::screens();
qDebug() << countMonitor.size();
}
return a.exec();
}
выходит такая ошибка: incompatible pointer types assigning to 'int *[]' from 'int *'
int *_ptr;
smart_ptr(int *t) {
_ptr = t;
}