1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 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:FDL$
|
---|
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 a
|
---|
14 | ** written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Free Documentation License
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Free
|
---|
18 | ** Documentation License version 1.3 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file included in the packaging of this
|
---|
20 | ** file.
|
---|
21 | **
|
---|
22 | ** If you have questions regarding the use of this file, please contact
|
---|
23 | ** Nokia at [email protected].
|
---|
24 | ** $QT_END_LICENSE$
|
---|
25 | **
|
---|
26 | ****************************************************************************/
|
---|
27 |
|
---|
28 | /*!
|
---|
29 | \page qt-embedded-vnc.html
|
---|
30 | \brief A guide to using Qt for Embedded Linux applications as VNC servers
|
---|
31 | and clients.
|
---|
32 |
|
---|
33 | \title The VNC Protocol and Qt for Embedded Linux
|
---|
34 | \ingroup qt-embedded-linux
|
---|
35 |
|
---|
36 | VNC (Virtual Network Computing) software makes it possible to view
|
---|
37 | and interact with one computer (the "server") from any other
|
---|
38 | computer or mobile device (the "viewer") anywhere on a network.
|
---|
39 |
|
---|
40 | \image qt-embedded-vnc-screen.png
|
---|
41 |
|
---|
42 | VNC clients are available for a vast array of display systems, including
|
---|
43 | X11, Mac OS X and Windows.
|
---|
44 |
|
---|
45 | \section1 Configuring Qt with VNC Capabilities
|
---|
46 |
|
---|
47 | To run a \l{Qt for Embedded Linux} application using the VNC protocol, the
|
---|
48 | \l{Qt for Embedded Linux} library must be configured and compiled with the
|
---|
49 | \c -qt-gfx-vnc option:
|
---|
50 |
|
---|
51 | \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc 0
|
---|
52 |
|
---|
53 | \section1 Running a Server Application
|
---|
54 |
|
---|
55 | Start a server application by specifying the \c -qws command
|
---|
56 | line option when running the application. (This can also be
|
---|
57 | specified in the application's source code.)
|
---|
58 | Use the \c -display command line option to specify the VNC server's
|
---|
59 | driver and the virtual screen to use. For example:
|
---|
60 |
|
---|
61 | \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc 1
|
---|
62 |
|
---|
63 | The application will act as a VNC server which can be accessed using
|
---|
64 | an ordinary VNC client, either on the development machine or from a
|
---|
65 | different machine on a network.
|
---|
66 |
|
---|
67 | For example, using the X11 VNC client to view the application from the
|
---|
68 | same machine:
|
---|
69 |
|
---|
70 | \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc 2
|
---|
71 |
|
---|
72 | To interact with the application from another machine on the network,
|
---|
73 | run a VNC client pointing to the machine that is running the server
|
---|
74 | application.
|
---|
75 |
|
---|
76 | \l{Qt for Embedded Linux} will create a 640 by 480 pixel display by
|
---|
77 | default. Alternatively, the \c QWS_SIZE environment variable can be
|
---|
78 | used to set another size; e.g., \c{QWS_SIZE=240x320}.
|
---|
79 |
|
---|
80 | \section1 Running Client Applications
|
---|
81 |
|
---|
82 | If you want to run more than one application on the same display, you
|
---|
83 | only need to start the first one as a server application, using the
|
---|
84 | \c -qws command line option to indicate that it will manage other
|
---|
85 | windows.
|
---|
86 |
|
---|
87 | \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc Starting server
|
---|
88 |
|
---|
89 | Subsequent client applications can be started \e without the \c -qws
|
---|
90 | option, but will each require the same \c -display option and argument
|
---|
91 | as those used for the server.
|
---|
92 |
|
---|
93 | \snippet doc/src/snippets/code/doc_src_emb-vnc.qdoc Starting clients
|
---|
94 |
|
---|
95 | However, for the clients, this option will not cause a new VNC server
|
---|
96 | to be started, but only indicates that their windows will appear on the
|
---|
97 | virtual screen managed by the server application.
|
---|
98 |
|
---|
99 | \section1 Related Resources
|
---|
100 |
|
---|
101 | It is not always necessary to specify the \c -qws command line option
|
---|
102 | when running a server application as long as the QApplication object
|
---|
103 | used by the application has been constructed with the
|
---|
104 | QApplication::GuiServer flag.
|
---|
105 |
|
---|
106 | See the \l{Running Qt for Embedded Linux Applications}{running applications}
|
---|
107 | documentation for more details about server and client applications.
|
---|
108 |
|
---|
109 | \table
|
---|
110 | \row
|
---|
111 | \o \bold {The Virtual Framebuffer}
|
---|
112 |
|
---|
113 | The \l{The Virtual Framebuffer}{virtual framebuffer} is
|
---|
114 | an alternative technique recommended for development and debugging
|
---|
115 | purposes.
|
---|
116 |
|
---|
117 | The virtual framebuffer emulates a framebuffer using a shared
|
---|
118 | memory region and the \c qvfb tool to display the framebuffer in a
|
---|
119 | window.
|
---|
120 |
|
---|
121 | Its use of shared memory makes the virtual framebuffer much faster
|
---|
122 | and smoother than using the VNC protocol, but it does not operate
|
---|
123 | over a network.
|
---|
124 |
|
---|
125 | \o \inlineimage qt-embedded-virtualframebuffer.png
|
---|
126 | \endtable
|
---|
127 | */
|
---|