QT学习笔记(八):嵌入式Linux下的QT程序的运行及相应的参数
2012-02-06 15:07
766 查看
JUST FOR QT 4.6
(主要是说明了同一屏幕怎样显示不同窗口的功能,还有就是详细的程序参数的说明。)
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.
Applications can run using both single and multiple displays, and various command line options are available.
Note that this document assumes that you either are using the The Virtual Framebuffer or that you are running Qt
for Embedded Linux using the VNC protocol, or that you have the Linux framebuffer configured correctly and that no server process
is running. (To test that the Linux framebuffer is set up correctly, use the program provided by the Testing the Linux Framebuffer document.)
Using a Single Display
Using Multiple Displays
Command Line Options
with the -qws option:
Additional applications can be run as clients, i.e., by running these applications without the -qws option they will connect to the existing server as clients. You can exit the server application at any time using Ctrl+Alt+Backspace.
When running multiple server processes, the screen driver (and display number) must be specified for each process using the -displaycommand line option or by setting the QWS_DISPLAY environment
variable. For example:
See the display management documentation for more details on how to specify a screen driver. Note that you must also specify the
display (i.e., server process) when starting client applications:
There is no way of moving a client from one display to another when running multiple server processes. Using the Multi screen driver, on the other hand, applications can easiliy be moved between the various screens.
The Multi screen driver can be specified just like any other screen driver by using the -display command line option or by setting theQWS_DISPLAY environment
variable. For example:
See the display management documentation for details regarding arguments.
(主要是说明了同一屏幕怎样显示不同窗口的功能,还有就是详细的程序参数的说明。)
Running Qt for Embedded Linux Applications
A Qt for Embedded Linux application requires a server application to be running, or to be the server application itself. Any Qtfor 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.
Applications can run using both single and multiple displays, and various command line options are available.
Note that this document assumes that you either are using the The Virtual Framebuffer or that you are running Qt
for Embedded Linux using the VNC protocol, or that you have the Linux framebuffer configured correctly and that no server process
is running. (To test that the Linux framebuffer is set up correctly, use the program provided by the Testing the Linux Framebuffer document.)
Using a Single Display
Using Multiple Displays
Command Line Options
Using a Single Display
To run the application using a single display, change to a Linux console and select an application to run, e.g. demos/textedit. Run the applicationwith the -qws option:
cd path/to/QtEmbedded/demos/textedit ./textedit -qws
Provided that the environment variables are adjusted properly during the installation process, you should see theText Edit demo appear. It might be that the hardware drivers must be specified explicitly to make everything work properly. For more information, please consult the following documentation: Pointer Handling Character Input Display Management |
Using Multiple Displays
Qt for Embedded Linux also allows multiple displays to be used simultaneously. There are two ways of achieving this: Either run multiple Qt for Embedded Linux server processes, or use the ready-made Multi screen driver.When running multiple server processes, the screen driver (and display number) must be specified for each process using the -displaycommand line option or by setting the QWS_DISPLAY environment
variable. For example:
./myfirstserverapplication -qws -display "transformed:rot90:1" ./mysecondserverapplication -qws -display "QVFb:2"
See the display management documentation for more details on how to specify a screen driver. Note that you must also specify the
display (i.e., server process) when starting client applications:
./myclientapplication -display "QVFb:2"
There is no way of moving a client from one display to another when running multiple server processes. Using the Multi screen driver, on the other hand, applications can easiliy be moved between the various screens.
The Multi screen driver can be specified just like any other screen driver by using the -display command line option or by setting theQWS_DISPLAY environment
variable. For example:
./myserverapplication -qws -display "Multi: QVFb:0 QVFb:1:offset=0,0 VNC:offset=640,0 :2"
See the display management documentation for details regarding arguments.
Command Line Options
Option | Description |
---|---|
-fn <font> | Defines the application font. For example:./myapplication -fn helvetica The font should be specified using an X logical font description. |
-bg <color> | Sets the default application background color. For example:./myapplication -bg blue The color-name must be one of the names recognized by the QColor constructor. |
-btn <color> | Sets the default button color. For example:./myapplication -btn green The color-name must be one of the names recognized by the QColor constructor. |
-fg <color> | Sets the default application foreground color. For example:./myapplication -fg 'dark blue' The color-name must be one of the names recognized by the QColor constructor. |
-name <objectname> | Sets the application name, i.e. the application object's object name. For example:./myapplication -name texteditapplication |
-title <title> | Sets the application's title. For example:./myapplication -title 'Text Edit' |
-geometry <width>x<height>+<Xoffset>+<Yoffset> | Sets the client geometry of the first window that is shown. For example:./myapplication -geometry 300x200+50+50 |
-keyboard | Enables the keyboard. See also: Qt for Embedded Linux Character Input. |
-nokeyboard | Disables the keyboard. |
-mouse | Enables the mouse cursor. See also: Qt for Embedded Linux Pointer Handling. |
-nomouse | Disables the mouse cursor. |
-qws | Runs the application as a server application, i.e. constructs a QApplication object of theQApplication::GuiServer type. |
-display | Specifies the screen driver. See also: Qt for Embedded Linux Display Management. |
-decoration <style> | Sets the application decoration. For example:./myapplication -decoration windows The supported styles are windows, default and styled. See also QDecoration. |
相关文章推荐
- QT学习笔记(三):在嵌入式Linux平台上部署QT程序
- 【Qt开发】【Linux开发】Qt程序在嵌入式设备(arm) 上运行,鼠标擦除界面的解决方案
- 在ARM开发板的嵌入式linux系统上运行的QT程序,必须得要在linux里用QT编吗
- Hello Qt(在Linux下编写运行Qt程序)
- Ubuntux下QT编写 linux嵌入式开发板的程序
- linux下Qt程序编译运行
- 嵌入式Qt程序启动参数-qws
- 把linux运行的Qt程序移植到windows下出现的错误
- Qt 嵌入式程序 运行时遇到*** glibc detected ***等解决方法
- Linux环境下运行Qt程序连接数据库报错
- QT学习之路(二)————Linux下搭建qt程序编译环境、开发板上搭建qt程序运行环境
- QT学习笔记(五):嵌入式Linux下的QT框架
- Qt学习笔记(二)Qt程序生成apk文件在Android上运行所需的配置
- Linux下如何运行一个QT的程序
- 解决qt程序运行时的cannot create Qt for Embedded Linux data directory: /tmp/qtembedded-0
- QT在嵌入式Linux环境下运行
- linux renice命令参数及用法详解(linux修改程序运行优先级命令)
- linux下同时运行不同版本的qt程序
- Qt程序在嵌入式设备(arm) 上运行,鼠标擦除界面的解决方案
- QT嵌入式程序,成功运行