[556] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
| 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
| 6 | **
|
---|
| 7 | ** This file is part of the documentation of the Qt Toolkit.
|
---|
| 8 | **
|
---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 10 | ** Commercial Usage
|
---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 14 | ** a written agreement between you and Nokia.
|
---|
| 15 | **
|
---|
| 16 | ** GNU Lesser General Public License Usage
|
---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 20 | ** packaging of this file. Please review the following information to
|
---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 23 | **
|
---|
| 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
| 27 | **
|
---|
| 28 | ** GNU General Public License Usage
|
---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 32 | ** packaging of this file. Please review the following information to
|
---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 35 | **
|
---|
| 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at [email protected].
|
---|
| 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 | /*!
|
---|
| 43 | \page qt-embedded-running.html
|
---|
| 44 |
|
---|
| 45 | \title Running Qt for Embedded Linux Applications
|
---|
| 46 | \ingroup qt-embedded-linux
|
---|
| 47 |
|
---|
| 48 | A \l{Qt for Embedded Linux} application requires a server application to be
|
---|
| 49 | running, or to be the server application itself. Any \l{Qt for Embedded Linux}
|
---|
| 50 | application can be the server application by constructing the QApplication
|
---|
| 51 | object with the QApplication::GuiServer type, or by running the application
|
---|
| 52 | with the \c -qws command line option.
|
---|
| 53 |
|
---|
| 54 | Applications can run using both single and multiple displays, and
|
---|
| 55 | various command line options are available.
|
---|
| 56 |
|
---|
| 57 | Note that this document assumes that you either are using the
|
---|
| 58 | \l{The Virtual Framebuffer} or that you are running \l{Qt for Embedded Linux}
|
---|
| 59 | using the \l {The VNC Protocol and Qt for Embedded Linux}{VNC} protocol,
|
---|
| 60 | \e or that you have the Linux framebuffer configured
|
---|
| 61 | correctly and that no server process is running. (To test that the
|
---|
| 62 | Linux framebuffer is set up correctly, use the program provided by
|
---|
| 63 | the \l {Testing the Linux Framebuffer} document.)
|
---|
| 64 |
|
---|
| 65 | \tableofcontents
|
---|
| 66 |
|
---|
| 67 | \section1 Using a Single Display
|
---|
| 68 |
|
---|
| 69 | To run the application using a single display, change to a Linux
|
---|
| 70 | console and select an application to run, e.g. \l {Text
|
---|
| 71 | Edit}{demos/textedit}. Run the application with the \c -qws
|
---|
| 72 | option:
|
---|
| 73 |
|
---|
| 74 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 0
|
---|
| 75 |
|
---|
| 76 | \table 100%
|
---|
| 77 | \row
|
---|
| 78 | \o
|
---|
| 79 | Provided that the environment variables are adjusted properly
|
---|
| 80 | during the \l {Installing Qt on Embedded Linux}{installation process}, you
|
---|
| 81 | should see the \l {Text Edit} demo appear.
|
---|
| 82 |
|
---|
| 83 | It might be that the hardware drivers must be specified explicitly
|
---|
| 84 | to make everything work properly. For more information, please
|
---|
| 85 | consult the following documentation:
|
---|
| 86 |
|
---|
| 87 | \list
|
---|
| 88 | \o \l{Qt for Embedded Linux Pointer Handling}{Pointer Handling}
|
---|
| 89 | \o \l{Qt for Embedded Linux Character Input}{Character Input}
|
---|
| 90 | \o \l{Qt for Embedded Linux Display Management}{Display Management}
|
---|
| 91 | \endlist
|
---|
| 92 |
|
---|
| 93 | \o
|
---|
| 94 | \inlineimage qt-embedded-runningapplication.png
|
---|
| 95 | \endtable
|
---|
| 96 |
|
---|
| 97 | Additional applications can be run as clients, i.e., by running
|
---|
| 98 | these applications \e without the \c -qws option they will connect
|
---|
| 99 | to the existing server as clients. You can exit the server
|
---|
| 100 | application at any time using \gui{Ctrl+Alt+Backspace}.
|
---|
| 101 |
|
---|
| 102 | \section1 Using Multiple Displays
|
---|
| 103 |
|
---|
| 104 | Qt for Embedded Linux also allows multiple displays to be used
|
---|
| 105 | simultaneously. There are two ways of achieving this: Either run
|
---|
| 106 | multiple Qt for Embedded Linux server processes, or use the
|
---|
| 107 | ready-made \c Multi screen driver.
|
---|
| 108 |
|
---|
| 109 | When running multiple server processes, the screen driver (and
|
---|
| 110 | display number) must be specified for each process using the \c
|
---|
| 111 | -display command line option or by setting the QWS_DISPLAY
|
---|
| 112 | environment variable. For example:
|
---|
| 113 |
|
---|
| 114 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 1
|
---|
| 115 |
|
---|
| 116 | See the \l {Qt for Embedded Linux Display Management}{display management}
|
---|
| 117 | documentation for more details on how to specify a screen
|
---|
| 118 | driver. Note that you must also specify the display (i.e., server
|
---|
| 119 | process) when starting client applications:
|
---|
| 120 |
|
---|
| 121 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 2
|
---|
| 122 |
|
---|
| 123 | There is no way of moving a client from one display to another
|
---|
| 124 | when running multiple server processes. Using the \c Multi screen
|
---|
| 125 | driver, on the other hand, applications can easiliy be moved
|
---|
| 126 | between the various screens.
|
---|
| 127 |
|
---|
| 128 | The \c Multi screen driver can be specified just like any other
|
---|
| 129 | screen driver by using the \c -display command line option or by
|
---|
| 130 | setting the QWS_DISPLAY environment variable. For example:
|
---|
| 131 |
|
---|
| 132 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 3
|
---|
| 133 |
|
---|
| 134 | See the \l {Qt for Embedded Linux Display Management}{display management}
|
---|
| 135 | documentation for details regarding arguments.
|
---|
| 136 |
|
---|
| 137 | \section1 Command Line Options
|
---|
| 138 |
|
---|
| 139 | \table 100%
|
---|
| 140 | \header
|
---|
| 141 | \o Option \o Description
|
---|
| 142 | \row
|
---|
| 143 | \o \bold -fn <font>
|
---|
| 144 | \o
|
---|
| 145 | Defines the application font. For example:
|
---|
| 146 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 4
|
---|
| 147 | The font should be specified using an X logical font description.
|
---|
| 148 | \row
|
---|
| 149 | \o \bold -bg <color>
|
---|
| 150 | \o
|
---|
| 151 | Sets the default application background color. For example:
|
---|
| 152 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 5
|
---|
| 153 | The color-name must be one of the names recognized by the QColor constructor.
|
---|
| 154 | \row
|
---|
| 155 | \o \bold -btn <color> \o
|
---|
| 156 | Sets the default button color. For example:
|
---|
| 157 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 6
|
---|
| 158 | The color-name must be one of the names recognized by the QColor constructor.
|
---|
| 159 | \row
|
---|
| 160 | \o \bold -fg <color> \o
|
---|
| 161 | Sets the default application foreground color. For example:
|
---|
| 162 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 7
|
---|
| 163 | The color-name must be one of the names recognized by the QColor constructor.
|
---|
| 164 | \row
|
---|
| 165 | \o \bold -name <objectname> \o
|
---|
| 166 | Sets the application name, i.e. the application object's object name. For example:
|
---|
| 167 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 8
|
---|
| 168 | \row
|
---|
| 169 | \o \bold -title <title> \o
|
---|
| 170 | Sets the application's title. For example:
|
---|
| 171 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 9
|
---|
| 172 | \row
|
---|
| 173 | \o \bold -geometry <width>x<height>+<Xoffset>+<Yoffset> \o
|
---|
| 174 | Sets the client geometry of the first window that is shown. For example:
|
---|
| 175 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 10
|
---|
| 176 | \row
|
---|
| 177 | \o \bold -keyboard \o
|
---|
| 178 | Enables the keyboard.
|
---|
| 179 |
|
---|
| 180 | See also: \l {Qt for Embedded Linux Character Input}.
|
---|
| 181 | \row
|
---|
| 182 | \o \bold -nokeyboard \o
|
---|
| 183 | Disables the keyboard.
|
---|
| 184 | \row
|
---|
| 185 | \o \bold -mouse \o
|
---|
| 186 | Enables the mouse cursor.
|
---|
| 187 |
|
---|
| 188 | See also: \l {Qt for Embedded Linux Pointer Handling}.
|
---|
| 189 | \row
|
---|
| 190 | \o \bold -nomouse \o
|
---|
| 191 | Disables the mouse cursor.
|
---|
| 192 | \row
|
---|
| 193 | \o \bold -qws \o
|
---|
| 194 | Runs the application as a server application, i.e. constructs a
|
---|
| 195 | QApplication object of the QApplication::GuiServer type.
|
---|
| 196 | \row
|
---|
| 197 | \o \bold -display \o
|
---|
| 198 | Specifies the screen driver.
|
---|
| 199 |
|
---|
| 200 | See also: \l {Qt for Embedded Linux Display Management}.
|
---|
| 201 | \row
|
---|
| 202 | \o \bold -decoration <style>\o
|
---|
| 203 | Sets the application decoration. For example:
|
---|
| 204 | \snippet doc/src/snippets/code/doc_src_emb-running.qdoc 11
|
---|
| 205 | The supported styles are \c windows, \c default and \c styled.
|
---|
| 206 |
|
---|
| 207 | See also QDecoration.
|
---|
| 208 |
|
---|
| 209 | \endtable
|
---|
| 210 | */
|
---|