summaryrefslogtreecommitdiffstats
path: root/doc/src/porting/qt3to4.qdoc
blob: 0b3212f6110d5d809fda2c3462adb921003e3e8d (plain)
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights.  These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \page qt3to4.html
    \title qt3to4 - The Qt 3 to 4 Porting Tool

    \ingroup porting
    \keyword qt3to4

    The \c qt3to4 tool provides help when moving a project from Qt 3
    to Qt 4. It is designed to automate the most tedious part of the
    porting effort.

    See \l{Porting to Qt 4} and \l{Porting UI Files to Qt 4} for
    more information about porting Qt 3 applications to Qt 4.

    \section1 Usage

    \c qt3to4 can be run either on individual C++ source or header
    files, or on an entire project specified by a \c qmake \c .pro
    file:

    \snippet doc/src/snippets/code/doc_src_qt3to4.qdoc 0

    In project mode, \c qt3to4 reads the \c .pro file and converts
    all files specified in it. The tool modifies the files in place.
    You might want to make a copy of your project before you run the
    tool.

    \section1 Porting Rules

    The Qt porting tool loads its porting rules from an XML file
    called \c q3porting.xml located in Qt's \c tools/porting/src directory. 
    By editing this file, you can add your own rules or remove some
    rules.

    The standard \c q3porting.xml file specifies the following
    conversions:

    \list
    \o  Rename classes that are now part of the Qt 3 support
        library (e.g., replace \c QFileDialog with \c{Q3FileDialog}).
    \o  Prefix or rename enum values that have been moved or
        renamed (e.g., replace \c QButton::On with \c{QCheckBox::On}) or
        members of the Qt namespace (e.g., replace \c QWidget::red with
        \c{Qt::red}).
    \o  Add \c #include directives that might be needed in Qt 4.
    \endlist

    \section2 Location of the qt3porting.xml File

    You can now specify the location of the \c qt3porting.xml file with the
    \c{-f} command line option. This is useful if you want to use a modified
    file with your own rules. 

    If you you don't want to maintain a modified \c qt3porting.xml it is
    possible to create a "patch" file that includes the original file and adds
    or disables rules. The syntax for this file looks like this:

    \snippet doc/src/snippets/code/doc_src_qt3to4.qdoc 1

    \section1 Logging

    The porting tool logs all changes to a file called \c
    portinglog.txt in the current directory. This file lists all
    changes made to the source files.

    \section1 Advanced Usage

    When porting, \c qt3to4 parses the source files and ports the
    contents according to the C++ language rules. This C++ parsing
    step can be disabled with the \c -disableCppParsing option.

    If C++ parsing is enabled, \c qt3to4 must be able to locate the
    headers included from the source files. Necessary headers include
    the public Qt headers and  any headers that declares names that
    may conflict with names in the public Qt headers. The standard
    C++ headers and system headers are usually not needed.

    You can tell \c qt3to4 where to look for headers by using the
    \c{-I} command-line option. Qt 3.3 header information is built
    in, so it is normaly not necessary to specify the location of the
    Qt headers. If you are porting from a different version of Qt 3,
    you may want to disable the built-in headers with
    \c{-disableBuiltInQt3Headers}, and then add the path to the
    actual headers with the \c{-I} option.

    When porting a project, \c qt3to4 will read the \c INCLUDEPATH
    and \c DEPENDPATH variables from the \c .pro file and add the
    paths specified here to the list of include search directories.

    To see which headers that are not found, use the \c{-missingFileWarnings}
    option.

    \section1 Limitations

    In some cases, you might get compiler errors because of identifiers
    in the global namespace (e.g., \c CTRL). Adding

    \snippet doc/src/snippets/code/doc_src_qt3to4.qdoc 2

    at the beginning of the source file that contains
    the indentifier solves the problem.

    \section1 Legal Notices

    Some source code in \c qt3to4 is licensed under specific highly
    permissive licenses from the original authors. Nokia gratefully
    acknowledges these contributions to \c qt3to4 and all uses of
    \c qt3to4 should also acknowledge these contributions and quote the
    following license statements in an appendix to the documentation.

    \list
    \o \l{Contributions to the Following qt3to4 Files: treewalker.h,
    treedump.cpp, treedump.h, treewalker.cpp}
    \endlist
*/

/*!
    \page qt3to4-treewalker.html
    \title Contributions to the Following qt3to4 Files: treewalker.h, treedump.cpp, treedump.h, treewalker.cpp
    \ingroup licensing
    \brief License information for contributions to the qt3to4 source code.

    \legalese
    Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). \BR
    Copyright (C) 2005 Roberto Raggi

    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
    "Software"), to deal in the Software without restriction, including
    without limitation the rights to use, modify, market, reproduce,
    grant sublicenses and distribute subject to the following
    conditions:  The above copyright notice and this permission notice
    shall be included in all copies or substantial portions of the
    Software.  These files are provided AS IS with NO WARRANTY OF ANY
    KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTIBILITY AND FITNESS
    FOR A PARTICULAR PURPOSE.
    \endlegalese
*/