如何设置 QWidget 全屏(但“真正的”全屏,更改分辨率,将模式设置为整个系统)?
我正在尝试使用 Qt 制作一款游戏,因为它太棒了;)并且您可以免费获得所需的所有东西。唯一的问题是更改系统分辨率和设置 QWidget(或 QGLWidget)“真实”全屏。
你们中有人成功做过这样的事情吗?这种方法的可移植性如何?我想在所有桌面系统上部署我的应用程序。
也许使用 SDL 或类似 SMFL 之类的东西使其全屏显示?
请分享您的技巧!
干杯。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这......
使您的小部件达到全屏分辨率。这不是你需要的吗?
编辑:
或者,您可以调用插槽 showFullScreen。
编辑2:
相同
This...
... brings your widget to a full screen resolution. Isn't that what you need?
Edit:
Alternatively you can call the slot showFullScreen.
Edit 2:
首先,您必须设置相应的窗口标志以使您的小部件模式化,并摆脱窗口管理器框架,使其成为真正的全屏
widget->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);< /code>
然后调用
widget->showFullScreen();
正如 Exa 所说。First you have to set corresponding window flags to make your widget modal, and also get rid of the window manager frame so it will be true fullscreen
widget->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint);
and after that call
widget->showFullScreen();
as Exa said.全屏:
Fullscreen: