Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 4987

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/doc/src/emb-running.qdoc -->
<head>
  <title>Qt 4.2: Running Applications</title>
  <link rel="contents" href="qtopiacore.html" />
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><p>
[<a href="qtopiacore.html">Contents</a>]
</p>
<h1 align="center">Running Applications<br /><small></small></h1>
<p>A Qtopia Core application requires a master application to be running, or to be the master application itself. The master application is responsible for managing top-level window regions, pointer handling and character input. Any Qtopia Core application can be the master 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>An application can be run using both single and multiple displays, and various command line option are also available.</p>
<p>Note that this document assumes that you either are using the <a href="qtopiacore-qvfb.html">Qtopia Core Virtual Framebuffer</a> or are running Qtopia Core using the <a href="qtopiacore-vnc.html">VNC</a> protocol, <i>or</i> that you have the Linux framebuffer configured correctly and that no master process is running. (To test that the Linux framebuffer is set up correctly, use the program provided by the <a href="qtopiacore-testingframebuffer.html">Testing the Linux Framebuffer</a> document.)</p>
<ul><li><a href="#using-a-single-display">Using a Single Display</a></li>
<li><a href="#using-multiple-displays">Using Multiple Displays</a></li>
<li><a href="#command-line-options">Command Line Options</a></li>
</ul>
<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> cd path/to/Qtopia/Core/demos/textedit
 ./textedit -qws</pre>
<p><table width="100%" align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td>Provided that the environment variables are adjusted properly during the <a href="qtopiacore-install.html">installation process</a>, you should see the <a href="demos-textedit.html">Text Edit</a> demo appear.<p>If the input methods don't work properly, the input driver and device must be specified explicitly. For more information, please consult the following documentation:</p>
<ul>
<li><a href="qtopiacore-pointer.html">Pointer Handling</a></li>
<li><a href="qtopiacore-charinput.html">Character Input</a></li>
</ul>
</td><td><img src="images/qtopiacore-runningapplication.png" /></td></tr>
</table></p>
<p>Additional applications should be run as clients, i.e. without the <tt>-qws</tt> option. You can exit the master application at any time using <b>Ctrl+Alt+Backspace</b>.</p>
<a name="using-multiple-displays"></a>
<h2>Using Multiple Displays</h2>
<p>Qtopia Core also allows multiple displays to be used simultaneously by running multiple Qtopia Core master processes. This is achieved using the <tt>-display</tt> command line parameter or the <a href="qtopiacore-envvars.html#qws-display">QWS_DISPLAY</a> environment variable.</p>
<p>The <tt>-display</tt> parameter's syntax is:</p>
<pre> &lt;gfx driver&gt;&lt;:driver specific options&gt;&lt;:display number&gt;</pre>
<p>The valid drivers are <tt>LinuxFb</tt>, <tt>QVfb</tt>, <tt>VNC</tt> and <tt>Transformed</tt>. For example, use the following code to run the example and demo launcher <a href="tools-qtdemo.html">Qt Demo</a>, on a transformed display:</p>
<pre> cd path/to/Qtopia/Core/examples/tools/qtdemo
 qtdemo -qws -display transformed:rot90:1</pre>
<p>Alternatively, you can set the <a href="qtopiacore-envvars.html#qws-display">QWS_DISPLAY</a> environment variable before running the application. For example, if the current shell is bash, ksh, zsh or sh:</p>
<pre> export QWS_DISPLAY=&lt;gfx driver&gt;&lt;:driver specific options&gt;&lt;:display number&gt;</pre>
<a name="command-line-options"></a>
<h2>Command Line Options</h2>
<p><table width="100%" align="center" cellpadding="2" cellspacing="1" border="0">
<thead><tr valign="top" class="qt-style"><th>Option</th><th>Description</th></tr></thead>
<tr valign="top" class="odd"><td><b>-fn</b> &lt;font&gt;</td><td>Defines the application font. For example:<pre> ./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> &lt;color&gt;</td><td>Sets the default application background color. For example:<pre> ./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> &lt;color&gt;</td><td>Sets the default button color. For example:<pre> ./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> &lt;color&gt;</td><td>Sets the default application foreground color. For example:<pre> ./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> &lt;objectname&gt;</td><td>Sets the application name, i.e. the application object's object name. For example:<pre> ./myapplication -name texteditapplication</pre>
<p>See also <a href="qapplication.html#qApp">qApp</a>.</p>
</td></tr>
<tr valign="top" class="even"><td><b>-title</b> &lt;title&gt;</td><td>Sets the application's title. For example:<pre> ./myapplication -title 'Text Edit'</pre>
</td></tr>
<tr valign="top" class="odd"><td><b>-geometry</b> &lt;width&gt;x&lt;height&gt;x&lt;Xoffset&gt;x&lt;YOffset&gt;</td><td>Sets the client geometry of the first window that is shown. For example:<pre> ./myapplication -geometry 300x200x50x50</pre>
</td></tr>
<tr valign="top" class="even"><td><b>-keyboard</b></td><td>Enables the keyboard.<p>See also the <a href="qtopiacore-pointer.html">Pointer Handling</a> documentation.</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 the <a href="qtopiacore-pointer.html">Pointer Handling</a> documentation.</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 master application, i.e. constructs the <a href="qapplication.html">QApplication</a> object with 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 display driver.<p>See also the <a href="#using-multiple-displays">Using Multiple Displays</a> documentation.</p>
</td></tr>
<tr valign="top" class="even"><td><b>-decoration</b> &lt;style&gt;</td><td>Sets the application decoration. For example:<pre> ./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></p>
<p>
[<a href="qtopiacore.html">Contents</a>]
</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>