QRect screenRect = QApplication::desktop()->screenGeometry(1); // 0-indexed, so this would get the second screen this->move(QPoint(screenRect.x(), screenRect.y()));
but it's deprecated, so how I can write?
What setGeometry are you talking about ?
I'm pretty sure I suggested to you to use
screens()to query your desktop
QRect screenRect = QGuiApplication::screens().at(1)->availableGeometry();
You're aware that you're not checking if 2 screens are available before hand. This may at any time crash.
@SGaist setGeometry == screenGeometry, I presume.