Can't assign QScreen to QML Window
-
Doing some work with Qt now, but I'm stuck trying to figure out how to apply a screen to a QML Window element.
I'm doing this in the QML file
screen: app.getMonitor(this.screen);
and this corresponding function in CPP:
QScreen *getMonitor(QScreen* screen) { QList<QScreen*> screens = screen->virtualSiblings(); for(auto screen : screens) { qDebug() << "hi"; qDebug() << screen->name(); } return screens[1]; }
(The foreach loop is just for debugging purposes).
This doesn't work though. The program keeps saying:Error: Unknown method return type: QScreen*
Have I misunderstood something. What else can I try?