| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information ([email protected])
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the documentation of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** 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 are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | /****************************************************************************
|
|---|
| 43 | **
|
|---|
| 44 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 45 | ** Contact: Qt Software Information ([email protected])
|
|---|
| 46 | **
|
|---|
| 47 | ** This file is part of the Qt GUI Toolkit.
|
|---|
| 48 | ** EDITIONS: FREE, PROFESSIONAL, ENTERPRISE
|
|---|
| 49 | **
|
|---|
| 50 | ****************************************************************************/
|
|---|
| 51 |
|
|---|
| 52 | /*!
|
|---|
| 53 | \group deployment
|
|---|
| 54 | \title Deploying Qt Applications
|
|---|
| 55 | \ingroup buildsystem
|
|---|
| 56 |
|
|---|
| 57 | Deploying an Qt application does not require any C++
|
|---|
| 58 | programming. All you need to do is to build Qt and your
|
|---|
| 59 | application in release mode, following the procedures described in
|
|---|
| 60 | this documentation. We will demonstrate the procedures in terms of
|
|---|
| 61 | deploying the \l {tools/plugandpaint}{Plug & Paint} application
|
|---|
| 62 | that is provided in Qt's examples directory.
|
|---|
| 63 |
|
|---|
| 64 | \section1 Static vs. Shared Libraries
|
|---|
| 65 |
|
|---|
| 66 | There are two ways of deploying an application:
|
|---|
| 67 |
|
|---|
| 68 | \list
|
|---|
| 69 | \o Static Linking
|
|---|
| 70 | \o Shared Libraries (Frameworks on Mac)
|
|---|
| 71 | \endlist
|
|---|
| 72 |
|
|---|
| 73 | Static linking results in a stand-alone executable. The advantage
|
|---|
| 74 | is that you will only have a few files to deploy. The
|
|---|
| 75 | disadvantages are that the executables are large and with no
|
|---|
| 76 | flexibility (i.e a new version of the application, or of Qt, will
|
|---|
| 77 | require that the deployment process is repeated), and that you
|
|---|
| 78 | cannot deploy plugins.
|
|---|
| 79 |
|
|---|
| 80 | To deploy plugin-based applications, you can use the shared
|
|---|
| 81 | library approach. Shared libraries also provide smaller, more
|
|---|
| 82 | flexible executables. For example, using the shared library
|
|---|
| 83 | approach, the user is able to independently upgrade the Qt library
|
|---|
| 84 | used by the application.
|
|---|
| 85 |
|
|---|
| 86 | Another reason why you might want to use the shared library
|
|---|
| 87 | approach, is if you want to use the same Qt libraries for a family
|
|---|
| 88 | of applications. In fact, if you download the binary installation
|
|---|
| 89 | of Qt, you get Qt as a shared library.
|
|---|
| 90 |
|
|---|
| 91 | The disadvantage with the shared library approach is that you
|
|---|
| 92 | will get more files to deploy. For more information, see
|
|---|
| 93 | \l{sharedlibrary.html}{Creating Shared Libraries}.
|
|---|
| 94 |
|
|---|
| 95 | \section1 Deploying Qt's Libraries
|
|---|
| 96 |
|
|---|
| 97 | \table
|
|---|
| 98 | \header
|
|---|
| 99 | \o {4,1} Qt's Libraries
|
|---|
| 100 | \row
|
|---|
| 101 | \o \l {QtAssistant}
|
|---|
| 102 | \o \l {QAxContainer}
|
|---|
| 103 | \o \l {QAxServer}
|
|---|
| 104 | \o \l {QtCore}
|
|---|
| 105 | \row
|
|---|
| 106 | \o \l {QtDBus}
|
|---|
| 107 | \o \l {QtDesigner}
|
|---|
| 108 | \o \l {QtGui}
|
|---|
| 109 | \o \l {QtHelp}
|
|---|
| 110 | \row
|
|---|
| 111 | \o \l {QtNetwork}
|
|---|
| 112 | \o \l {QtOpenGL}
|
|---|
| 113 | \o \l {QtScript}
|
|---|
| 114 | \o \l {QtScriptTools}
|
|---|
| 115 | \row
|
|---|
| 116 | \o \l {QtSql}
|
|---|
| 117 | \o \l {QtSvg}
|
|---|
| 118 | \o \l {QtWebKit}
|
|---|
| 119 | \o \l {QtXml}
|
|---|
| 120 | \row
|
|---|
| 121 | \o \l {QtXmlPatterns}
|
|---|
| 122 | \o \l {Phonon Module}{Phonon}
|
|---|
| 123 | \o \l {Qt3Support}
|
|---|
| 124 | \endtable
|
|---|
| 125 |
|
|---|
| 126 | Since Qt is not a system library, it has to be redistributed along
|
|---|
| 127 | with your application; the minimum is to redistribute the run-time
|
|---|
| 128 | of the libraries used by the application. Using static linking,
|
|---|
| 129 | however, the Qt run-time is compiled into the executable.
|
|---|
| 130 |
|
|---|
| 131 | In particular, you will need to deploy Qt plugins, such as
|
|---|
| 132 | JPEG support or SQL drivers. For more information about plugins,
|
|---|
| 133 | see the \l {plugins-howto.html}{How to Create Qt Plugins}
|
|---|
| 134 | documentation.
|
|---|
| 135 |
|
|---|
| 136 | When deploying an application using the shared library approach
|
|---|
| 137 | you must ensure that the Qt libraries will use the correct path to
|
|---|
| 138 | find the Qt plugins, documentation, translation etc. To do this you
|
|---|
|
|---|