Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How Can I understand where mainWindow is?
there is a way to understand where is the MainWindow?
I used mainWindow::pos and I noticed that when it's in the first screen MainWindow::pos().width()= -1, but I don't know if it's always
@vale88 sorry, I explained badly, I saw that when mainWindow is in the first screen this->pos().x()=-1, but I don't know if it's right for all the screens
Why do you want to know ?
you can always check the screen its on
QScreen *screen = widget/mainwin->window()->windowHandle()->screen();
the x() should change depending on screen but i never checked it.
@mrjj ok tomorrow I try, so in this way I obtain 0 or 1 and I understand which is the screen..
@mrjj if I write this I obtain the name of the screen , but I need only to know if it's the first screen or the secondary
(do not call from constructor as windowHandle() is not set there yet)
QScreen *screen = this->window()->windowHandle()->screen(); if ( QGuiApplication::primaryScreen() == screen ) qDebug() << "yes!";