1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- emb-running.qdoc -->
<title>Qt 4.8: Running Qt for Embedded Linux Applications</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li>Running Qt for Embedded Linux Applications</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#using-a-single-display">Using a Single Display</a></li>
<li class="level1"><a href="#using-multiple-displays">Using Multiple Displays</a></li>
<li class="level1"><a href="#command-line-options">Command Line Options</a></li>
</ul>
</div>
<h1 class="title">Running Qt for Embedded Linux Applications</h1>
<span class="subtitle"></span>
<!-- $$$qt-embedded-running.html-description -->
<div class="descr"> <a name="details"></a>
<p>A <a href="qt-embedded-linux.html">Qt for Embedded Linux</a> application requires a server application to be running, or to be the server application itself. Any <a href="qt-embedded-linux.html">Qt for Embedded Linux</a> application can be the server application by constructing the <a href="qapplication.html">QApplication</a> object with the <a href="qapplication.html#Type-enum">QApplication::GuiServer</a> type, or by running the application with the <tt>-qws</tt> command line option.</p>
<p>Applications can run using both single and multiple displays, and various command line options are available.</p>
<p>Note that this document assumes that you either are using the <a href="qvfb.html">The Virtual Framebuffer</a> or that you are running <a href="qt-embedded-linux.html">Qt for Embedded Linux</a> using the <a href="qt-embedded-vnc.html">VNC</a> protocol, <i>or</i> 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 <a href="qt-embedded-testingframebuffer.html">Testing the Linux Framebuffer</a> document.)</p>
<a name="using-a-single-display"></a>
<h2>Using a Single Display</h2>
<p>To run the application using a single display, change to a Linux console and select an application to run, e.g. <a href="demos-textedit.html">demos/textedit</a>. Run the application with the <tt>-qws</tt> option:</p>
<pre class="cpp"> cd path/to/QtEmbedded/demos/textedit
./textedit -qws</pre>
<table class="generic" width="100%">
<tr valign="top" class="odd"><td >Provided that the environment variables are adjusted properly during the <a href="qt-embedded-install.html">installation process</a>, you should see the <a href="demos-textedit.html">Text Edit</a> demo appear.<p>It might be that the hardware drivers must be specified explicitly to make everything work properly. For more information, please consult the following documentation:</p>
<ul>
<li><a href="qt-embedded-pointer.html">Pointer Handling</a></li>
<li><a href="qt-embedded-charinput.html">Character Input</a></li>
<li><a href="qt-embedded-displaymanagement.html">Display Management</a></li>
</ul>
</td><td ><img src="images/qt-embedded-runningapplication.png" alt="" /></td></tr>
</table>
<p>Additional applications can be run as clients, i.e., by running these applications <i>without</i> the <tt>-qws</tt> option they will connect to the existing server as clients. You can exit the server application at any time using <b>Ctrl+Alt+Backspace</b>.</p>
<a name="using-multiple-displays"></a>
<h2>Using Multiple Displays</h2>
<p>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 <tt>Multi</tt> screen driver.</p>
<p>When running multiple server processes, the screen driver (and display number) must be specified for each process using the <tt>-display</tt> command line option or by setting the <a href="qt-embedded-envvars.html#qws-display">QWS_DISPLAY</a> environment variable. For example:</p>
<pre class="cpp"> ./myfirstserverapplication -qws -display "transformed:rot90:1"
./mysecondserverapplication -qws -display "QVFb:2"</pre>
<p>See the <a href="qt-embedded-displaymanagement.html">display management</a> 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:</p>
<pre class="cpp"> ./myclientapplication -display "QVFb:2"</pre>
<p>There is no way of moving a client from one display to another when running multiple server processes. Using the <tt>Multi</tt> screen driver, on the other hand, applications can easiliy be moved between the various screens.</p>
<p>The <tt>Multi</tt> screen driver can be specified just like any other screen driver by using the <tt>-display</tt> command line option or by setting the <a href="qt-embedded-envvars.html#qws-display">QWS_DISPLAY</a> environment variable. For example:</p>
<pre class="cpp"> ./myserverapplication -qws -display "Multi: QVFb:0
QVFb:1:offset=0,0 VNC:offset=640,0 :2"</pre>
<p>See the <a href="qt-embedded-displaymanagement.html">display management</a> documentation for details regarding arguments.</p>
<a name="command-line-options"></a>
<h2>Command Line Options</h2>
<table class="generic" width="100%">
<thead><tr class="qt-style"><th >Option</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><b>-fn</b> <font></td><td >Defines the application font. For example:<pre class="cpp"> ./myapplication -fn helvetica</pre>
<p>The font should be specified using an X logical font description.</p>
</td></tr>
<tr valign="top" class="even"><td ><b>-bg</b> <color></td><td >Sets the default application background color. For example:<pre class="cpp"> ./myapplication -bg blue</pre>
<p>The color-name must be one of the names recognized by the <a href="qcolor.html">QColor</a> constructor.</p>
</td></tr>
<tr valign="top" class="odd"><td ><b>-btn</b> <color></td><td >Sets the default button color. For example:<pre class="cpp"> ./myapplication -btn green</pre>
<p>The color-name must be one of the names recognized by the <a href="qcolor.html">QColor</a> constructor.</p>
</td></tr>
<tr valign="top" class="even"><td ><b>-fg</b> <color></td><td >Sets the default application foreground color. For example:<pre class="cpp"> ./myapplication -fg 'dark blue'</pre>
<p>The color-name must be one of the names recognized by the <a href="qcolor.html">QColor</a> constructor.</p>
</td></tr>
<tr valign="top" class="odd"><td ><b>-name</b> <objectname></td><td >Sets the application name, i.e. the application object's object name. For example:<pre class="cpp"> ./myapplication -name texteditapplication</pre>
</td></tr>
<tr valign="top" class="even"><td ><b>-title</b> <title></td><td >Sets the application's title. For example:<pre class="cpp"> ./myapplication -title 'Text Edit'</pre>
</td></tr>
<tr valign="top" class="odd"><td ><b>-geometry</b> <width>x<height>+<Xoffset>+<Yoffset></td><td >Sets the client geometry of the first window that is shown. For example:<pre class="cpp"> ./myapplication -geometry 300x200+50+50</pre>
</td></tr>
<tr valign="top" class="even"><td ><b>-keyboard</b></td><td >Enables the keyboard.<p>See also: <a href="qt-embedded-charinput.html">Qt for Embedded Linux Character Input</a>.</p>
</td></tr>
<tr valign="top" class="odd"><td ><b>-nokeyboard</b></td><td >Disables the keyboard.</td></tr>
<tr valign="top" class="even"><td ><b>-mouse</b></td><td >Enables the mouse cursor.<p>See also: <a href="qt-embedded-pointer.html">Qt for Embedded Linux Pointer Handling</a>.</p>
</td></tr>
<tr valign="top" class="odd"><td ><b>-nomouse</b></td><td >Disables the mouse cursor.</td></tr>
<tr valign="top" class="even"><td ><b>-qws</b></td><td >Runs the application as a server application, i.e. constructs a <a href="qapplication.html">QApplication</a> object of the <a href="qapplication.html#Type-enum">QApplication::GuiServer</a> type.</td></tr>
<tr valign="top" class="odd"><td ><b>-display</b></td><td >Specifies the screen driver.<p>See also: <a href="qt-embedded-displaymanagement.html">Qt for Embedded Linux Display Management</a>.</p>
</td></tr>
<tr valign="top" class="even"><td ><b>-decoration</b> <style></td><td >Sets the application decoration. For example:<pre class="cpp"> ./myapplication -decoration windows</pre>
<p>The supported styles are <tt>windows</tt>, <tt>default</tt> and <tt>styled</tt>.</p>
<p>See also <a href="qdecoration.html">QDecoration</a>.</p>
</td></tr>
</table>
</div>
<!-- @@@qt-embedded-running.html -->
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|