要获取运行时的屏幕数量,可以使用:
int screenCount = QApplication::desktop()->screenCount();
Run Code Online (Sandbox Code Playgroud)
要获取屏幕的几何形状,可以使用:
QRect screenRect = QApplication::desktop()->screenGeometry(1); // 0-indexed, so this would get the second screen
Run Code Online (Sandbox Code Playgroud)
将窗口移到该位置(或调整其大小)很简单:
yourWindow->move(QPoint(screenRect.x(), screenRect.y()));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
800 次 |
| 最近记录: |