窗口如何在qt嵌入中工作?

时间:2022-03-25 15:22:06

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?

窗口如何在qt嵌入中工作,Qt直接绘制到帧缓冲区而不是通过单独的窗口系统?我可以一次运行多个程序吗?我是否得到合成和小[x]按钮,最大化等等?

3 个解决方案

#1


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.

您需要运行一个应用程序作为服务器来提供窗口管理功能;例如,在运行它时在命令行传递-qws选项。

Any other applications are run as clients. See this page for details:

任何其他应用程序作为客户端运行。有关详情,请参阅此页面:

http://doc.qt.digia.com/4.5/qt-embedded-running.html

#2


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.

你问的问题是什么部分?如果你想要一个基本的概述,可以想象它有点像Linux上的X-windows服务器,其中帧缓冲区绘制边框,装饰等,只有Qt库被编译为更直接地使用帧缓冲区而不是它们。 X-windows服务器。帧缓冲的各个方面也可以被程序覆盖,而不是需要由窗口服务器来改变。但是,对于大多数使用Qt的UI工作,您将使用常规桌面版本中的某些类(QDialog等)。它们只是由不同的底层绘制。

#3


From the Qt documentation :

从Qt文档:

A Qt for Embedded Linux application requires a server application to be running, or to be the server application itself. Any Qt for Embedded Linux application can be the server application by constructing the QApplication object with the QApplication::GuiServer type, or by running the application with the -qws command line option.

Qt for Embedded Linux应用程序需要运行服务器应用程序,或者作为服务器应用程序本身。任何Qt for Embedded Linux应用程序都可以是服务器应用程序,方法是使用QApplication :: GuiServer类型构建QApplication对象,或者使用-qws命令行选项运行应用程序。

So you can pass QApplication::GuiServer as the third parameter to the QApplication constructor to have a server :

因此,您可以将QApplication :: GuiServer作为第三个参数传递给QApplication构造函数以获得服务器:

QApplication app( argc, argv, QApplication::GuiServer );

Or pass -qws argument to application to run it as server :

或者将-qws参数传递给应用程序以将其作为服务器运行:

./MyApp -qws

Other applications should run as clients.

其他应用程序应作为客户端运行

#1


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.

您需要运行一个应用程序作为服务器来提供窗口管理功能;例如,在运行它时在命令行传递-qws选项。

Any other applications are run as clients. See this page for details:

任何其他应用程序作为客户端运行。有关详情,请参阅此页面:

http://doc.qt.digia.com/4.5/qt-embedded-running.html

#2


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.

你问的问题是什么部分?如果你想要一个基本的概述,可以想象它有点像Linux上的X-windows服务器,其中帧缓冲区绘制边框,装饰等,只有Qt库被编译为更直接地使用帧缓冲区而不是它们。 X-windows服务器。帧缓冲的各个方面也可以被程序覆盖,而不是需要由窗口服务器来改变。但是,对于大多数使用Qt的UI工作,您将使用常规桌面版本中的某些类(QDialog等)。它们只是由不同的底层绘制。

#3


From the Qt documentation :

从Qt文档:

A Qt for Embedded Linux application requires a server application to be running, or to be the server application itself. Any Qt for Embedded Linux application can be the server application by constructing the QApplication object with the QApplication::GuiServer type, or by running the application with the -qws command line option.

Qt for Embedded Linux应用程序需要运行服务器应用程序,或者作为服务器应用程序本身。任何Qt for Embedded Linux应用程序都可以是服务器应用程序,方法是使用QApplication :: GuiServer类型构建QApplication对象,或者使用-qws命令行选项运行应用程序。

So you can pass QApplication::GuiServer as the third parameter to the QApplication constructor to have a server :

因此,您可以将QApplication :: GuiServer作为第三个参数传递给QApplication构造函数以获得服务器:

QApplication app( argc, argv, QApplication::GuiServer );

Or pass -qws argument to application to run it as server :

或者将-qws参数传递给应用程序以将其作为服务器运行:

./MyApp -qws

Other applications should run as clients.

其他应用程序应作为客户端运行