qt Embedded 中的窗口如何工作?
窗口在 qt 嵌入式中如何工作,其中 Qt 直接绘制到帧缓冲区而不是通过单独的窗口系统? 我可以同时运行多个程序吗? 我可以获得合成、小 [x] 按钮、最大化等功能吗?
How does windowing work in qt embedded, where Qt is drawing directly to a framebuffer instead of through a separate windowing system? Can I run multiple programs at once? Do I get compositing and the little [x] button, maximizing and so forth?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要运行一个应用程序作为服务器来提供窗口管理功能; 例如,运行时在命令行中传递 -qws 选项。
任何其他应用程序都作为客户端运行。 有关详细信息,请参阅此页面:
http://doc.qt.digia。 com/4.5/qt-embedded-running.html
You need to run one application as the server to provide window management facilities; for example, by passing the -qws option at the command line when you run it.
Any other applications are run as clients. See this page for details:
http://doc.qt.digia.com/4.5/qt-embedded-running.html
您问的是它的工作原理的哪一部分? 如果你想要一个基本的概述,可以把它想象成 Linux 上的 X-windows 服务器,其中帧缓冲区绘制边框、装饰等,只有 Qt 库被编译为比使用帧缓冲区更直接地工作。 X-windows 服务器。 帧缓冲区的各个方面也可以由程序覆盖,而不需要由窗口服务器更改。 然而,对于大多数使用 Qt 的 UI 工作,您将使用与常规桌面版本完全相同的一些类(QDialog 等)。 它们只是由不同的底层绘制的。
What part of how does it work are you asking about? If you want a basic overview, think of it kind of like a X-windows server on Linux, where the framebuffer draws the border, decorations, etc., only the Qt libraries are compiled to work more directly with the framebuffer than they do with X-windows servers. Various aspects of the framebuffer can be overridden by a program as well, rather than needing to be changed by the window server. However, for most of your UI work with Qt, you'd be using the exact some classes (QDialog, etc.) that you would on a regular desktop version. They are just drawn by a different underlying layer.
来自 Qt 文档:
因此,您可以将
QApplication::GuiServer
作为第三个参数传递给QApplication
构造函数来拥有服务器:或者将
-qws
参数传递给应用程序将其作为服务器运行:其他应用程序应作为客户端运行。
From the Qt documentation :
So you can pass
QApplication::GuiServer
as the third parameter to theQApplication
constructor to have a server :Or pass
-qws
argument to application to run it as server :Other applications should run as clients.