source: trunk/doc/html/porting.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 46.4 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/porting3.doc:36 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>Porting to Qt 3.x</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>Porting to Qt 3.x</h1>
33
34
35
36<p> This document describes porting applications from Qt 2.x to Qt 3.x.
37<p> The Qt 3.x series is not binary compatible with the 2.x series. This
38means programs compiled for Qt 2.x must be recompiled to work with Qt
393.x. Qt 3.x is also not completely <em>source</em> compatible with 2.x,
40however all points of incompatibility cause compiler errors or
41run-time messages (rather than mysterious results). Qt 3.x includes
42many additional features and discards obsolete functionality. Porting
43from Qt 2.x to Qt 3.x is straightforward, and once completed makes
44the considerable additional power and flexibility of Qt 3.x available
45for use in your applications.
46<p> To port code from Qt 2.x to Qt 3.x:
47<p> <ol type=1>
48<p> <li> Briefly read the porting notes below to get an idea of what to expect.
49<li> Be sure your code compiles and runs well on all your target platforms
50with Qt 2.x.
51<li> Recompile with Qt 3.x. For each error, search below for related
52identifiers (e.g. function names, class names). This document
53mentions all relevant identifiers to help you get the information
54you need at the cost of being a little verbose.
55<li> If you get stuck, ask on the <a href="http://qt-interest.trolltech.com/">qt-interest</a> mailing list, or Trolltech Technical Support if
56you're a registered licensee.
57<p> </ol>
58<p> Table of contents:
59<p> <!-- toc -->
60<ul>
61<li><a href="#1"> Link Errors on Windows
62</a>
63<li><a href="#2"> Header file inclusion changes
64</a>
65<li><a href="#3"> Namespace
66</a>
67<li><a href="#4"> Removed Functions
68</a>
69<li><a href="#5"> Obsoleted Functions
70</a>
71<li><a href="#6"> Collection Class Renaming
72</a>
73<li><a href="#7"> QButtonGroup
74</a>
75<li><a href="#8"> QDate
76</a>
77<li><a href="#9"> QFileDialog
78</a>
79<li><a href="#10"> QFont
80</a>
81<li><a href="#11"> QInputDialog
82</a>
83<li><a href="#12"> QLayout and Other Abstract Layout Classes
84</a>
85<li><a href="#13"> QListViewItem
86</a>
87<li><a href="#14"> QMoveEvent
88</a>
89<li><a href="#15"> QMultiLineEdit
90</a>
91<li><a href="#16"> QPrinter
92</a>
93<li><a href="#17"> QRegExp
94</a>
95<ul>
96<li><a href="#17-1"> New special characters
97</a>
98<li><a href="#17-2"> QRegExp::operator=()
99</a>
100<li><a href="#17-3"> QRegExp::match()
101</a>
102<li><a href="#17-4"> QRegExp::find()
103</a>
104<li><a href="#17-5"> QString::findRev() and QString::contains()
105</a>
106<li><a href="#17-6"> QString::replace()
107</a>
108</ul>
109<li><a href="#18"> QSemiModal
110</a>
111<li><a href="#19"> QSortedList
112</a>
113<li><a href="#20"> QTableView
114</a>
115<li><a href="#21"> QToolButton
116</a>
117<li><a href="#22"> QTextStream
118</a>
119<li><a href="#23"> QTranslator
120</a>
121<li><a href="#24"> QWidget
122</a>
123<li><a href="#25"> QXml Classes
124</a>
125<ul>
126<li><a href="#25-1"> QXmlInputSource
127</a>
128<li><a href="#25-2"> QXmlLocator
129</a>
130</ul>
131<li><a href="#26"> Asynchronous I/O Classes
132</a>
133<li><a href="#27"> Transparent widgets
134</a>
135<li><a href="#28"> Bezier Curves
136</a>
137<li><a href="#29"> Locale-aware String Comparisons in QIconView, QListBox,
138QListView and QTable
139</a>
140</ul>
141<!-- endtoc -->
142
143<p> <a name="Linkerrors"></a>
144<h2> Link Errors on Windows
145</h2>
146<a name="1"></a><p> On Windows, originally in Qt 2.x, the default configuration of the Qt
147library is static. If you just use the default configuration you
148don't need to set certain preprocessor defines. In Qt 3.0, the
149default configuration of the Qt library is to build it as a shared
150library, therefore the preprocessor define <tt>QT_DLL</tt> is needed.
151<p> If you use tmake with Qt 2.x, and now use qmake with Qt 3.x, then the
152cause of the problem is with the project file. In the project file,
153there is usually line that looks like:
154<p> <tt>CONFIG</tt> = ...
155<p> this should be changed to
156<p> <tt>CONFIG</tt> += ...
157<p> so that qmake can look at the configuration that Qt was built with and
158set any relevant preprocessor defines in the makefile.
159<p> <a name="Headers"></a>
160<h2> Header file inclusion changes
161</h2>
162<a name="2"></a><p> Qt 3.x remove some unnecessary nested #include directives from
163header files. This speeds up compilation when you don't need those
164nested header files. But in some cases you will find you need to add
165an extra #include to your files.
166<p> For example, if you get a message about <a href="qstringlist.html">QStringList</a> or its functions
167not being defined, then add <tt>#include &lt;qstringlist.h&gt;</tt> at
168the top of the file giving the error.
169<p> Header files that you might need to add #include directives for include:
170<ul>
171<li> <tt>&lt;qcursor.h&gt;</tt>
172<li> <tt>&lt;qpainter.h&gt;</tt>
173<li> <tt>&lt;qpen.h&gt;</tt>
174<li> <tt>&lt;qstringlist.h&gt;</tt>
175<li> <tt>&lt;qregexp.h&gt;</tt>
176<li> <tt>&lt;qstrlist.h&gt;</tt>
177<li> <tt>&lt;qstyle.h&gt;</tt>
178<li> <tt>&lt;qvaluelist.h&gt;</tt>
179</ul>
180<p> <h2> Namespace
181</h2>
182<a name="3"></a><p> Qt 3.x is namespace clean. A few global identifiers that had been
183left in Qt 2.x have been discarded.
184<p> Enumeration <a href="qt.html#CursorShape-enum">Qt::CursorShape</a> and its values are now part of the
185special <a href="qt.html">Qt</a> class defined in qnamespace.h. If you get compilation
186errors about these being missing (unlikely, since most of your code will
187be in classes that inherit from the Qt namespace class), then apply
188the following changes:
189<p> <ul>
190<li> <tt>QCursorShape</tt> becomes <a href="qt.html#CursorShape-enum">Qt::CursorShape</a>
191<li> <tt>ArrowCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::ArrowCursor</a>
192<li> <tt>UpArrowCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::UpArrowCursor</a>
193<li> <tt>CrossCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::CrossCursor</a>
194<li> <tt>WaitCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::WaitCursor</a>
195<li> <tt>IbeamCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::IbeamCursor</a>
196<li> <tt>SizeVerCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SizeVerCursor</a>
197<li> <tt>SizeHorCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SizeHorCursor</a>
198<li> <tt>SizeBDiagCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SizeBDiagCursor</a>
199<li> <tt>SizeFDiagCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SizeFDiagCursor</a>
200<li> <tt>SizeAllCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SizeAllCursor</a>
201<li> <tt>BlankCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::BlankCursor</a>
202<li> <tt>SplitVCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SplitVCursor</a>
203<li> <tt>SplitHCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::SplitHCursor</a>
204<li> <tt>PointingHandCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::PointingHandCursor</a>
205<li> <tt>BitmapCursor</tt> becomes <a href="qt.html#CursorShape-enum">Qt::BitmapCursor</a>
206</ul>
207<p> The names of some debugging macro variables have been changed. We have
208tried not to break source compatibility as much as possible. If you observe
209error messages on the UNIX console or the Windows debugging stream that were
210previously disabled, please check these macro variables:
211<p> <ul>
212<li> <tt>DEBUG</tt> becomes <tt>QT_DEBUG</tt>
213<li> <tt>NO_DEBUG</tt> becomes <tt>QT_NO_DEBUG</tt>
214<li> <tt>NO_CHECK</tt> becomes <tt>QT_NO_CHECK</tt>
215<li> <tt>CHECK_STATE</tt> becomes <tt>QT_CHECK_STATE</tt>
216<li> <tt>CHECK_RANGE</tt> becomes <tt>QT_CHECK_RANGE</tt>
217<li> <tt>CHECK_NULL</tt> becomes <tt>QT_CHECK_NULL</tt>
218<li> <tt>CHECK_MATH</tt> becomes <tt>QT_CHECK_MATH</tt>
219</ul>
220<p> The name of some debugging macro functions has been changed as well
221but source compatibility should not be affected if the macro variable
222<tt>QT_CLEAN_NAMESPACE</tt> is not defined:
223<p> <ul>
224<li> <tt>ASSERT</tt> becomes <tt>Q_ASSERT</tt>
225<li> <tt>CHECK_PTR</tt> becomes <tt>Q_CHECK_PTR</tt>
226</ul>
227<p> For the record, undocumented macro variables that are not part of the API
228have been changed:
229<p> <ul>
230<li> <tt>_OS_*_</tt> becomes <tt>Q_OS_*</tt>
231<li> <tt>_WS_*_</tt> becomes <tt>Q_WS_*</tt>
232<li> <tt>_CC_*_</tt> becomes <tt>Q_CC_*</tt>
233</ul>
234<p> <h2> Removed Functions
235</h2>
236<a name="4"></a><p> All these functions have been removed in Qt 3.x:
237<ul>
238<li> QFont::charSet()
239<li> QFont::setCharSet()
240<li> QMenuBar::setActItem()
241<li> QMenuBar::setWindowsAltMode()
242<li> QObject::initMetaObject()
243<li> QPainter::drawQuadBezier()
244<li> QPointArray::quadBezier()
245<li> QRegExp::find()
246<li> QSpinBox::downButton()
247<li> QSpinBox::upButton()
248<li> QString::basicDirection()
249<li> QString::visual()
250<li> QStyle::set...() functions
251<li> QStyle::drawArrow()
252<li> QWidget::setFontPropagation()
253<li> QWidget::setPalettePropagation()
254</ul>
255<p> Also, to avoid conflicts with <tt>&lt;iostream&gt;</tt>, the following three
256global functions have been renamed:
257<ul>
258<li> setw() (renamed qSetW())
259<li> setfill() (renamed qSetFill())
260<li> setprecision() (renamed qSetPrecision())
261</ul>
262<p> <h2> Obsoleted Functions
263</h2>
264<a name="5"></a><p> The following functions have been obsoleted in Qt 3.0. The
265documentation of each of these functions should explain how to
266replace them in Qt 3.0.
267<p> <b>Warning:</b> It is best to consult <a href="http://doc.trolltech.com/3.0/">http://doc.trolltech.com/3.0/</a>
268rather than the documentation supplied with Qt to obtain the latest
269information regarding obsolete functions and how to replace them in
270new code.
271<p> <ul>
272<li> <a href="qaccel.html#keyToString">QAccel::keyToString</a>( <a href="qkeysequence.html">QKeySequence</a> k )
273<li> <a href="qaccel.html#stringToKey">QAccel::stringToKey</a>( const <a href="qstring.html">QString</a> &amp; s )
274<li> <a href="qactiongroup.html#insert">QActionGroup::insert</a>( <a href="qaction.html">QAction</a> *a )
275<li> <a href="qbutton.html#autoResize">QButton::autoResize</a>() const
276<li> <a href="qbutton.html#setAutoResize">QButton::setAutoResize</a>( bool )
277<li> <a href="qcanvasitem.html#active">QCanvasItem::active</a>() const
278<li> <a href="qcanvasitem.html#enabled">QCanvasItem::enabled</a>() const
279<li> <a href="qcanvasitem.html#selected">QCanvasItem::selected</a>() const
280<li> <a href="qcanvasitem.html#visible">QCanvasItem::visible</a>() const
281<li> <a href="qcanvaspixmaparray.html#QCanvasPixmapArray">QCanvasPixmapArray::QCanvasPixmapArray</a>( <a href="qptrlist.html">QPtrList</a>&lt;QPixmap&gt; list, QPtrList&lt;QPoint&gt; hotspots )
282<li> <a href="qcanvaspixmaparray.html#operator!">QCanvasPixmapArray::operator!</a>()
283<li> <a href="qcolorgroup.html#QColorGroup">QColorGroup::QColorGroup</a>( const <a href="qcolor.html">QColor</a> &amp; foreground, const QColor &amp; background, const QColor &amp; light, const QColor &amp; dark, const QColor &amp; mid, const QColor &amp; text, const QColor &amp; base )
284<li> <a href="qcombobox.html#autoResize">QComboBox::autoResize</a>() const
285<li> <a href="qcombobox.html#setAutoResize">QComboBox::setAutoResize</a>( bool )
286<li> <a href="qdate.html#dayName">QDate::dayName</a>( int weekday )
287<li> <a href="qdate.html#monthName">QDate::monthName</a>( int month )
288<li> <a href="qdir.html#encodedEntryList">QDir::encodedEntryList</a>( const <a href="qstring.html">QString</a> &amp; nameFilter, int filterSpec = DefaultFilter, int sortSpec = DefaultSort ) const
289<li> QDir::encodedEntryList( int filterSpec = DefaultFilter, int sortSpec = DefaultSort ) const
290<li> <a href="qdockwindow.html#isHorizontalStretchable">QDockWindow::isHorizontalStretchable</a>() const
291<li> <a href="qdockwindow.html#isVerticalStretchable">QDockWindow::isVerticalStretchable</a>() const
292<li> <a href="qdockwindow.html#setHorizontalStretchable">QDockWindow::setHorizontalStretchable</a>( bool b )
293<li> <a href="qdockwindow.html#setVerticalStretchable">QDockWindow::setVerticalStretchable</a>( bool b )
294<li> <a href="qfont.html#defaultFont">QFont::defaultFont</a>()
295<li> <a href="qfont.html#setDefaultFont">QFont::setDefaultFont</a>( const <a href="qfont.html">QFont</a> &amp; f )
296<li> <a href="qfont.html#setPixelSizeFloat">QFont::setPixelSizeFloat</a>( float pixelSize )
297<li> <a href="qfontdatabase.html#bold">QFontDatabase::bold</a>( const QString &amp; family, const QString &amp; style, const <a href="qstring.html">QString</a> &amp; ) const
298<li> <a href="qfontdatabase.html#families">QFontDatabase::families</a>( bool ) const
299<li> <a href="qfontdatabase.html#font">QFontDatabase::font</a>( const QString &amp; familyName, const QString &amp; style, int pointSize, const QString &amp; )
300<li> <a href="qfontdatabase.html#isBitmapScalable">QFontDatabase::isBitmapScalable</a>( const QString &amp; family, const QString &amp; style, const QString &amp; ) const
301<li> <a href="qfontdatabase.html#isFixedPitch">QFontDatabase::isFixedPitch</a>( const QString &amp; family, const QString &amp; style, const QString &amp; ) const
302<li> <a href="qfontdatabase.html#isScalable">QFontDatabase::isScalable</a>( const QString &amp; family, const QString &amp; style, const QString &amp; ) const
303<li> <a href="qfontdatabase.html#isSmoothlyScalable">QFontDatabase::isSmoothlyScalable</a>( const QString &amp; family, const QString &amp; style, const QString &amp; ) const
304<li> <a href="qfontdatabase.html#italic">QFontDatabase::italic</a>( const <a href="qstring.html">QString</a> &amp; family, const QString &amp; style, const QString &amp; ) const
305<li> <a href="qfontdatabase.html#pointSizes">QFontDatabase::pointSizes</a>( const QString &amp; family, const QString &amp; style, const QString &amp; )
306<li> <a href="qfontdatabase.html#smoothSizes">QFontDatabase::smoothSizes</a>( const QString &amp; family, const QString &amp; style, const QString &amp; )
307<li> <a href="qfontdatabase.html#styles">QFontDatabase::styles</a>( const QString &amp; family, const QString &amp; ) const
308<li> <a href="qfontdatabase.html#weight">QFontDatabase::weight</a>( const QString &amp; family, const QString &amp; style, const QString &amp; ) const
309<li> <a href="qlabel.html#autoResize">QLabel::autoResize</a>() const
310<li> <a href="qlabel.html#setAutoResize">QLabel::setAutoResize</a>( bool enable )
311<li> <a href="qlineedit.html#cursorLeft">QLineEdit::cursorLeft</a>( bool mark, int steps = 1 )
312<li> <a href="qlineedit.html#cursorRight">QLineEdit::cursorRight</a>( bool mark, int steps = 1 )
313<li> <a href="qlineedit.html#hasMarkedText">QLineEdit::hasMarkedText</a>() const
314<li> <a href="qlineedit.html#markedText">QLineEdit::markedText</a>() const
315<li> <a href="qlineedit.html#repaintArea">QLineEdit::repaintArea</a>( int, int )
316<li> <a href="qlistbox.html#cellHeight">QListBox::cellHeight</a>( int i ) const
317<li> QListBox::cellHeight() const
318<li> <a href="qlistbox.html#cellWidth">QListBox::cellWidth</a>() const
319<li> <a href="qlistbox.html#findItem">QListBox::findItem</a>( int yPos ) const
320<li> <a href="qlistbox.html#inSort">QListBox::inSort</a>( const <a href="qlistboxitem.html">QListBoxItem</a> *lbi )
321<li> QListBox::inSort( const <a href="qstring.html">QString</a> &amp; text )
322<li> <a href="qlistbox.html#itemYPos">QListBox::itemYPos</a>( int index, int *yPos ) const
323<li> <a href="qlistbox.html#numCols">QListBox::numCols</a>() const
324<li> <a href="qlistbox.html#totalHeight">QListBox::totalHeight</a>() const
325<li> <a href="qlistbox.html#totalWidth">QListBox::totalWidth</a>() const
326<li> <a href="qlistboxitem.html#current">QListBoxItem::current</a>() const
327<li> <a href="qlistboxitem.html#selected">QListBoxItem::selected</a>() const
328<li> <a href="qlistview.html#removeItem">QListView::removeItem</a>( <a href="qlistviewitem.html">QListViewItem</a> *item )
329<li> <a href="qlistviewitem.html#removeItem">QListViewItem::removeItem</a>( QListViewItem *item )
330<li> <a href="qmainwindow.html#addToolBar">QMainWindow::addToolBar</a>( <a href="qdockwindow.html">QDockWindow</a> *, Dock = DockTop, bool newLine = FALSE )
331<li> QMainWindow::addToolBar( QDockWindow *, const QString &amp; label, Dock = DockTop, bool newLine = FALSE )
332<li> <a href="qmainwindow.html#lineUpToolBars">QMainWindow::lineUpToolBars</a>( bool keepNewLines = FALSE )
333<li> <a href="qmainwindow.html#moveToolBar">QMainWindow::moveToolBar</a>( QDockWindow *, Dock = DockTop )
334<li> QMainWindow::moveToolBar( QDockWindow *, Dock, bool nl, int index, int extraOffset = -1 )
335<li> <a href="qmainwindow.html#removeToolBar">QMainWindow::removeToolBar</a>( QDockWindow *)
336<li> <a href="qmainwindow.html#setToolBarsMovable">QMainWindow::setToolBarsMovable</a>( bool )
337<li> <a href="qmainwindow.html#toolBarPositionChanged">QMainWindow::toolBarPositionChanged</a>( <a href="qtoolbar.html">QToolBar</a> *)
338<li> <a href="qmainwindow.html#toolBarsMovable">QMainWindow::toolBarsMovable</a>() const
339<li> <a href="qmessagebox.html#message">QMessageBox::message</a>( const <a href="qstring.html">QString</a> &amp; caption, const QString &amp; text, const QString &amp; buttonText = <a href="qstring.html#QString-null">QString::null</a>, <a href="qwidget.html">QWidget</a> *parent = 0, const char *= 0 )
340<li> <a href="qmessagebox.html#query">QMessageBox::query</a>( const QString &amp; caption, const QString &amp; text, const QString &amp; yesButtonText = QString::null, const QString &amp; noButtonText = QString::null, QWidget *parent = 0, const char *= 0 )
341<li> <a href="qmessagebox.html#standardIcon">QMessageBox::standardIcon</a>( Icon icon, GUIStyle style )
342<li> <a href="qpalette.html#normal">QPalette::normal</a>()
343<li> <a href="qregexp.html#match">QRegExp::match</a>( const QString &amp; str, int index = 0, int *len = 0, bool indexIsStart = TRUE ) const
344<li> <a href="qscrollview.html#childIsVisible">QScrollView::childIsVisible</a>( QWidget *child )
345<li> <a href="qscrollview.html#showChild">QScrollView::showChild</a>( QWidget *child, bool show = TRUE )
346<li> <a href="qsignal.html#block">QSignal::block</a>( bool b )
347<li> <a href="qsignal.html#isBlocked">QSignal::isBlocked</a>() const
348<li> <a href="qsignal.html#parameter">QSignal::parameter</a>() const
349<li> <a href="qsignal.html#setParameter">QSignal::setParameter</a>( int value )
350<li> <a href="qsimplerichtext.html#draw">QSimpleRichText::draw</a>( <a href="qpainter.html">QPainter</a> *p, int x, int y, const <a href="qregion.html">QRegion</a> &amp; clipRegion, const <a href="qcolorgroup.html">QColorGroup</a> &amp; cg, const <a href="qbrush.html">QBrush</a> *paper = 0 ) const
351<li> <a href="qstring.html#ascii">QString::ascii</a>() const
352<li> <a href="qstring.html#data">QString::data</a>() const
353<li> <a href="qstring.html#setExpand">QString::setExpand</a>( uint index, <a href="qchar.html">QChar</a> c )
354<li> <a href="qstyle.html#defaultFrameWidth">QStyle::defaultFrameWidth</a>() const
355<li> <a href="qstyle.html#scrollBarExtent">QStyle::scrollBarExtent</a>() const
356<li> <a href="qstyle.html#tabbarMetrics">QStyle::tabbarMetrics</a>( const <a href="qwidget.html">QWidget</a> *t, int &amp; hf, int &amp; vf, int &amp; ov ) const
357<li> <a href="qtabdialog.html#isTabEnabled">QTabDialog::isTabEnabled</a>( const char *name ) const
358<li> <a href="qtabdialog.html#selected">QTabDialog::selected</a>( const <a href="qstring.html">QString</a> &amp; )
359<li> QTabDialog::selected( const QString &amp; tabLabel )
360<li> <a href="qtabdialog.html#setTabEnabled">QTabDialog::setTabEnabled</a>( const char *name, bool enable )
361<li> <a href="qtextstream.html#QTextStream">QTextStream::QTextStream</a>( QString &amp; str, int filemode )
362<li> <a href="qtoolbar.html#QToolBar">QToolBar::QToolBar</a>( const QString &amp; label, <a href="qmainwindow.html">QMainWindow</a> *, ToolBarDock = DockTop, bool newLine = FALSE, const char *name = 0 )
363<li> <a href="qtoolbutton.html#iconSet">QToolButton::iconSet</a>( bool on ) const
364<li> <a href="qtoolbutton.html#offIconSet">QToolButton::offIconSet</a>() const
365<li> <a href="qtoolbutton.html#onIconSet">QToolButton::onIconSet</a>() const
366<li> <a href="qtoolbutton.html#setIconSet">QToolButton::setIconSet</a>( const <a href="qiconset.html">QIconSet</a> &amp; set, bool on )
367<li> <a href="qtoolbutton.html#setOffIconSet">QToolButton::setOffIconSet</a>( const QIconSet &amp; )
368<li> <a href="qtoolbutton.html#setOnIconSet">QToolButton::setOnIconSet</a>( const QIconSet &amp; )
369<li> <a href="qtooltip.html#enabled">QToolTip::enabled</a>()
370<li> <a href="qtooltip.html#setEnabled">QToolTip::setEnabled</a>( bool enable )
371<li> <a href="qtranslator.html#find">QTranslator::find</a>( const char *context, const char *sourceText, const char *comment = 0 ) const
372<li> <a href="qtranslator.html#insert">QTranslator::insert</a>( const char *context, const char *sourceText, const <a href="qstring.html">QString</a> &amp; translation )
373<li> <a href="qtranslator.html#remove">QTranslator::remove</a>( const char *context, const char *sourceText )
374<li> <a href="quridrag.html#setFilenames">QUriDrag::setFilenames</a>( const <a href="qstringlist.html">QStringList</a> &amp; fnames )
375<li> <a href="qwidget.html#backgroundColor">QWidget::backgroundColor</a>() const
376<li> <a href="qwidget.html#backgroundPixmap">QWidget::backgroundPixmap</a>() const
377<li> <a href="qwidget.html#iconify">QWidget::iconify</a>()
378<li> <a href="qwidget.html#setBackgroundColor">QWidget::setBackgroundColor</a>( const <a href="qcolor.html">QColor</a> &amp; c )
379<li> <a href="qwidget.html#setBackgroundPixmap">QWidget::setBackgroundPixmap</a>( const <a href="qpixmap.html">QPixmap</a> &amp; pm )
380<li> <a href="qwidget.html#setFont">QWidget::setFont</a>( const <a href="qfont.html">QFont</a> &amp; f, bool )
381<li> <a href="qwidget.html#setPalette">QWidget::setPalette</a>( const <a href="qpalette.html">QPalette</a> &amp; p, bool )
382<li> <a href="qwizard.html#setFinish">QWizard::setFinish</a>( <a href="qwidget.html">QWidget</a> *, bool )
383<li> <a href="qxmlinputsource.html#QXmlInputSource">QXmlInputSource::QXmlInputSource</a>( <a href="qfile.html">QFile</a> &amp; file )
384<li> QXmlInputSource::QXmlInputSource( <a href="qtextstream.html">QTextStream</a> &amp; stream )
385<li> <a href="qxmlreader.html#parse">QXmlReader::parse</a>( const <a href="qxmlinputsource.html">QXmlInputSource</a> &amp; input )
386</ul>
387<p> Additionally, these preprocessor directives have been removed:
388<p> <ul>
389<li> <tt>#define strlen qstrlen</tt>
390<li> <tt>#define strcpy qstrcpy</tt>
391<li> <tt>#define strcmp qstrcmp</tt>
392<li> <tt>#define strncmp qstrncmp</tt>
393<li> <tt>#define stricmp qstricmp</tt>
394<li> <tt>#define strnicmp qstrnicmp</tt>
395</ul>
396<p> See the changes-3.0.0 document for an explanation of why this had to be done.
397You might have been relying on the non-portable and unpredictable behavior
398resulting from these directives. We strongly recommend that you either make
399use of the safe qstr* variants directly or ensure that no 0 pointer is
400passed to the standard C functions in your code base.
401<p> <h2> Collection Class Renaming
402</h2>
403<a name="6"></a><p> The classes QArray, QCollection, QList, QListIterator, QQueue, QStack
404and QVector have been renamed. To ease porting, the old names and the
405old header-file names are still supported.
406<p> <center><table cellpadding="4" cellspacing="2" border="0">
407<tr bgcolor="#a2c511"> <th valign="top">Old Name <th valign="top">New Name <th valign="top">New Header File
408<tr bgcolor="#f0f0f0"> <td valign="top">QArray <td valign="top"><a href="qmemarray.html">QMemArray</a> <td valign="top"><tt>&lt;qmemarray.h&gt;</tt>
409<tr bgcolor="#d0d0d0"> <td valign="top">QCollection <td valign="top"><a href="qptrcollection.html">QPtrCollection</a> <td valign="top"><tt>&lt;qptrcollection.h&gt;</tt>
410<tr bgcolor="#f0f0f0"> <td valign="top">QList <td valign="top"><a href="qptrlist.html">QPtrList</a> <td valign="top"><tt>&lt;qptrlist.h&gt;</tt>
411<tr bgcolor="#d0d0d0"> <td valign="top">QListIterator <td valign="top"><a href="qptrlistiterator.html">QPtrListIterator</a> <td valign="top"><tt>&lt;qptrlist.h&gt;</tt>
412<tr bgcolor="#f0f0f0"> <td valign="top">QQueue <td valign="top"><a href="qptrqueue.html">QPtrQueue</a> <td valign="top"><tt>&lt;qptrqueue.h&gt;</tt>
413<tr bgcolor="#d0d0d0"> <td valign="top">QStack <td valign="top"><a href="qptrstack.html">QPtrStack</a> <td valign="top"><tt>&lt;qptrstack.h&gt;</tt>
414<tr bgcolor="#f0f0f0"> <td valign="top">QVector <td valign="top"><a href="qptrvector.html">QPtrVector</a> <td valign="top"><tt>&lt;qptrvector.h&gt;</tt>
415</table></center>
416<p> <h2> <a href="qbuttongroup.html">QButtonGroup</a>
417</h2>
418<a name="7"></a><p> In Qt 2.x, the function <a href="qbuttongroup.html#selected">QButtonGroup::selected</a>() returns the selected
419<em>radio</em> button (<a href="qradiobutton.html">QRadioButton</a>). In Qt 3.0, it returns the selected <em>toggle</em> button (<a href="qbutton.html#toggleButton-prop">QButton::toggleButton</a>), a more general concept.
420This might affect programs that use QButtonGroups that contain a
421mixture of radio buttons and non-radio (e.g. <a href="qcheckbox.html">QCheckBox</a>) toggle buttons.
422<p> <h2> <a href="qdate.html">QDate</a>
423</h2>
424<a name="8"></a><p> Two QDate member functions that were virtual in Qt 2.0 are not virtual
425in Qt 3.0. This is only relevant if you subclassed QDate and
426reimplemented these functions:
427<p> <ul>
428<li> <a href="qstring.html">QString</a> <a href="qdate.html#monthName">QDate::monthName</a>( int month ) const
429<li> QString <a href="qdate.html#dayName">QDate::dayName</a>( int weekday ) const
430</ul>
431<p> In addition to no longer being virtual, QDate::monthName() and
432QDate::dayName() have been renamed <a href="qdate.html#shortMonthName">QDate::shortMonthName</a>() and
433<a href="qdate.html#shortDayName">QDate::shortDayName</a>() and have been made static (as they should had
434been in the first place). The old names are still provided for source
435compatibility.
436<p> <h2> <a href="qfiledialog.html">QFileDialog</a>
437</h2>
438<a name="9"></a><p> If the mode was not set explicitly, and the user entered a
439non-existent file, the dialog would accept this. In Qt 3.x, you must
440set the mode, e.g. setMode(QFileDialog::AnyFile), to get the same
441behavior.
442<p> <h2> <a href="qfont.html">QFont</a>
443</h2>
444<a name="10"></a><p> The internals of QFont have changed significantly between Qt 2.2 and
445Qt 3.0, to give better Unicode support and to make developing
446internationalized applications easier. The original API has been
447preserved with minimal changes. The CharSet enum and its related
448functions have disappeared. This is because Qt now handles all charset
449related issues internally, and removes this burden from the developer.
450<p> If you used the CharSet enum or its related functions, e.g
451QFont::charSet() or QFont::setCharSet(), just remove them from your
452code. There are a few functions that took a QFont::CharSet as a
453parameter; in these cases simply remove the charset from the
454parameter list.
455<p> <h2> <a href="qinputdialog.html">QInputDialog</a>
456</h2>
457<a name="11"></a><p> The two static getText(...) methods in QInputDialog have been merged.
458The <tt>echo</tt> parameter is the third parameter and defaults to
459QLineEdit::Normal.
460<p> If you used calls to <a href="qinputdialog.html#getText">QInputDialog::getText</a>(...) that provided more
461than the first two required parameters you will must add a value
462for the <tt>echo</tt> parameter.
463<p> <h2> <a href="qlayout.html">QLayout</a> and Other Abstract Layout Classes
464</h2>
465<a name="12"></a><p> The definitions of <a href="qglayoutiterator.html">QGLayoutIterator</a>, <a href="qlayout.html">QLayout</a>, <a href="qlayoutitem.html">QLayoutItem</a>, <a href="qlayoutiterator.html">QLayoutIterator</a>, <a href="qspaceritem.html">QSpacerItem</a> and <a href="qwidgetitem.html">QWidgetItem</a> have been moved from <tt>&lt;qabstractlayout.h&gt;</tt> to <tt>&lt;qlayout.h&gt;</tt>. The header <tt>&lt;qabstractlayout.h&gt;</tt> now includes <tt>&lt;qlayout.h&gt;</tt> for compatibility. It
466might be removed in a future version.
467<p> <h2> <a href="qlistviewitem.html">QListViewItem</a>
468</h2>
469<a name="13"></a><p> The paintBranches() function in Qt 2.x had a GUIStyle parameter; this
470has been dropped for Qt 3.x since GUI style is handled by the new
471style engine (See <a href="qstyle.html">QStyle</a>.)
472<p> <h2> <a href="qmoveevent.html">QMoveEvent</a>
473</h2>
474<a name="14"></a><p> In Qt 2.x, the function <a href="qmoveevent.html#pos">QMoveEvent::pos</a>() returned the position of the
475widget in its parent widget, including the window frame. In Qt 3.0,
476it returns the new position of the widget, excluding window frame for
477top level widgets.
478<p> <h2> QMultiLineEdit
479</h2>
480<a name="15"></a><p> The QMultiLineEdit was a simple editor widget in previous Qt versions.
481Since Qt 3.0 includes a new richtext engine, which also supports
482editing, QMultiLineEdit is obsolete. For the sake of compatibility
483QMultiLineEdit is still provided. It is now a subclass of <a href="qtextedit.html">QTextEdit</a>
484which wraps the old QMultiLineEdit so that it is mostly source
485compatible to keep old applications working.
486<p> For new applications and when maintaining existing applications we
487recommend that you use QTextEdit instead of QMultiLineEdit wherever
488possible.
489<p> Although most of the old QMultiLineEdit API is still available, there
490is one important difference. The old QMultiLineEdit operated in terms
491of lines, whereas QTextEdit operates in terms of paragraphs. This is
492because lines change all the time during wordwrap, whereas paragraphs
493remain paragraphs. The consequence of this change is that functions
494which previously operated on lines, e.g. numLines(), textLine(), etc.,
495now work on paragraphs.
496<p> Also the function getString() has been removed since it
497published the internal data structure.
498<p> In most cases, applications that used QMultiLineEdit will continue to
499work without problems. Applications that worked in terms of lines may
500require some porting.
501<p> The source code for the old 2.x version of QMultiLineEdit can be found
502in <tt>$QTDIR/src/attic/qtmultilineedit.h/cpp</tt>. Note that the class has
503been renamed to QtMultiLineEdit to avoid name clashes. If you really
504need to keep compatibility with the old QMultiLineEdit, simply include
505this class in your project and rename QMultiLineEdit to
506QtMultiLineEdit throughout.
507<p> <h2> <a href="qprinter.html">QPrinter</a>
508</h2>
509<a name="16"></a><p> QPrinter has undergone some changes, to make it more flexible and
510to ensure it has the same runtime behaviour on both Unix and Windows. In 2.x,
511QPrinter behaved differently on Windows and Unix, when using view
512transformations on the <a href="qpainter.html">QPainter</a>. This has changed now, and QPrinter
513behaves consistently across all platforms. A compatibilty mode has been
514added that forces the old behaviour, to ease porting from Qt 2.x
515to Qt 3.x. This compatibilty mode can be enabled by passing the
516QPrinter::Compatible flag to the QPrinter constructor.
517<p> On X11, QPrinter used to generate encapsulated postscript when
518fullPage() was TRUE and only one page was printed. This does not
519happen by default anymore, providing a more consistent printing output.
520<p> <h2> <a href="qregexp.html">QRegExp</a>
521</h2>
522<a name="17"></a><p> The <a href="qregexp.html">QRegExp</a> class has been rewritten to support many of the features of Perl
523regular expressions. Both the <a href="qregexp.html#regular-expression">regular expression</a> syntax and the QRegExp
524interface have been modified.
525<p> Be also aware that <tt>&lt;qregexp.h&gt;</tt> is no longer included
526automatically when you include <tt>&lt;qstringlist.h&gt;</tt>. See
527<a href="#Headers">above</a> for details.
528<p>
529<p> <h3> New special characters
530</h3>
531<a name="17-1"></a><p> There are five new special characters: <tt>(</tt>, <tt>)</tt>, <tt>{</tt>,
532<tt>|</tt> and <tt>}</tt> (parentheses, braces and pipe). When porting old
533regular expressions, you must add <tt>&#92;</tt> (backslash) in front of any
534of these (actually, <tt>&#92;&#92;</tt> in C++ strings), unless it is already
535there.
536<p> Example: Old code like
537<pre>
538 <a href="qregexp.html">QRegExp</a> rx( "([0-9|]*\\)" ); // works in Qt 2.x
539</pre>
540
541should be converted into
542<pre>
543 <a href="qregexp.html">QRegExp</a> rx( "\\([0-9\\|]*\\)" ); // works in Qt 2.x and 3.x
544</pre>
545
546(Within character classes, the backslash is not necessary in front of certain
547characters, e.g. <tt>|</tt>, but it doesn't hurt.)
548<p> Wildcard patterns need no conversion. Here are two examples:
549<pre>
550 <a href="qregexp.html">QRegExp</a> wild( "(*.*)" );
551 wild.<a href="qregexp.html#setWildcard">setWildcard</a>( TRUE );
552</pre>
553
554<pre>
555 // TRUE as third argument means wildcard
556 <a href="qregexp.html">QRegExp</a> wild( "(*.*)", FALSE, TRUE );
557</pre>
558
559However, when they are used, make sure to use <a href="qregexp.html#exactMatch">QRegExp::exactMatch</a>()
560rather than the obsolete <a href="qregexp.html#match">QRegExp::match</a>(). QRegExp::match(), like
561QRegExp::find(), tries to find a match somewhere in the target
562string, while QRegExp::exactMatch() tries to match the whole target
563string.
564<p> <h3> <a href="qregexp.html#operator-eq">QRegExp::operator=</a>()
565</h3>
566<a name="17-2"></a><p> This function has been replaced by <a href="qregexp.html#setPattern">QRegExp::setPattern</a>() in Qt 2.2.
567Old code such as
568<pre>
569 <a href="qregexp.html">QRegExp</a> rx( "alpha" );
570 rx.<a href="qregexp.html#setCaseSensitive">setCaseSensitive</a>( FALSE );
571 rx.<a href="qregexp.html#setWildcard">setWildcard</a>( TRUE );
572 rx = "beta";
573</pre>
574
575still compiles with Qt 3, but produces a different result (the case sensitivity
576and wildcard options are forgotten). This way,
577<pre>
578 rx = "beta";
579</pre>
580
581is the same as
582<pre>
583 rx = QRegExp( "beta" );
584</pre>
585
586which is what one expects.
587<p> <h3> QRegExp::match()
588</h3>
589<a name="17-3"></a><p> The following function is now obsolete, as it has an unwieldy
590parameter list and was poorly named:
591<ul>
592<li> bool <a href="qregexp.html#match">QRegExp::match</a>( const <a href="qstring.html">QString</a> &amp; str, int index = 0,
593int * len = 0, bool indexIsStart = TRUE ) const
594</ul>
595It will be removed in a future version of Qt. Its <a href="qregexp.html#match">documentation</a> explains how to replace it.
596<p> <h3> QRegExp::find()
597</h3>
598<a name="17-4"></a><p> This function was removed, after a brief appearance in Qt 2.2. Its
599name clashed with <a href="qstring.html#find">QString::find</a>(). Use <a href="qregexp.html#search">QRegExp::search</a>() or <a href="qstring.html#find">QString::find</a>() instead.
600<p> <h3> <a href="qstring.html#findRev">QString::findRev</a>() and <a href="qstring.html#contains">QString::contains</a>()
601</h3>
602<a name="17-5"></a><p> <a href="qstring.html#findRev">QString::findRev</a>()'s and <a href="qstring.html#contains">QString::contains</a>()'s semantics have changed
603between 2.0 and 3.0 to be more consistent with the other overloads.
604<p> For example,
605<pre>
606 QString( "" ).contains( QRegExp("") )
607</pre>
608
609returns 1 in Qt 2.0; it returns 0 in Qt 3.0. Also, "^" now really means
610start of input, so
611<pre>
612 QString( "Heisan Hoppsan" ).contains( QRegExp("^.*$") )
613</pre>
614
615returns 1, not 13 or 14.
616<p> This change affect very few existing programs.
617<p> <h3> <a href="qstring.html#replace">QString::replace</a>()
618</h3>
619<a name="17-6"></a><p> With Qt 1.0 and 2.0, a <a href="qstring.html">QString</a> is converted implicitly into a <a href="qregexp.html">QRegExp</a>
620as the first argument to QString::replace():
621<pre>
622 <a href="qstring.html">QString</a> text = fetch_it_from_somewhere();
623 text.<a href="qstring.html#replace">replace</a>( QString("[A-Z]+"), "" );
624</pre>
625
626With Qt 3.0, the compiler gives an error. The solution is to use a
627QRegExp cast:
628<pre>
629 text.replace( QRegExp("[A-Z]+"), "" );
630</pre>
631
632This change makes it possible to introduce a
633QString::replace(QString, QString) overload in a future version of Qt
634without breaking source compatibility.
635<p> <h2> QSemiModal
636</h2>
637<a name="18"></a><p> The QSemiModal class is now obsolete. You should call show() on a
638modal dialog instead.
639<p> <h2> QSortedList
640</h2>
641<a name="19"></a><p> The QSortedList class is now obsolete. Consider using a <a href="qdict.html">QDict</a>, a <a href="qmap.html">QMap</a>
642or a plain <a href="qptrlist.html">QPtrList</a> instead.
643<p> <h2> QTableView
644</h2>
645<a name="20"></a><p> The QTableView class has been obsoleted and is no longer a part of the
646Qt API. Either use the powerful <a href="qtable.html">QTable</a> class or the simplistic
647<a href="qgridview.html">QGridView</a> in any new code you create. If you really need the old table
648view for compatibility you can find it in <tt>$QTDIR/src/attic/qttableview.{cpp,h}</tt>. Note that the class has been
649renamed from QTableView to QtTableView to avoid name clashes. To use
650it, simply include it in your project and rename QTableView to
651QtTableView throughout.
652<p> <h2> <a href="qtoolbutton.html">QToolButton</a>
653</h2>
654<a name="21"></a><p> The <a href="qtoolbutton.html">QToolButton</a> class used to distinguish between "on" and "off"
655icons. In 3.0, this mechanism was moved into the <a href="qiconset.html">QIconSet</a> class
656(see <a href="qiconset.html#State-enum">QIconSet::State</a>).
657<p> The old <a href="qtoolbutton.html#onIconSet-prop">QToolButton::onIconSet</a> and <a href="qtoolbutton.html#offIconSet-prop">QToolButton::offIconSet</a>
658properties are still provided so that old source will compile, but
659their semantics have changed: they are now synonyms for <a href="qtoolbutton.html#iconSet-prop">QToolButton::iconSet</a>. If you used that distinction in Qt 2.x, you will
660need to adjust your code to use the <a href="qiconset.html">QIconSet</a> On/Off mechanism.
661<p> Likewise, the <em>on</em> parameter of these two functions is now ignored:
662<p> <ul>
663<li> void QToolButton::setIconSet ( const QIconSet &amp; set, bool on )
664<li> QIconSet QToolButton::iconSet ( bool on ) const
665</ul>
666<p> These functions are only provided for ease of porting. New code
667should use the following instead:
668<p> <ul>
669<li> void <a href="qtoolbutton.html#setIconSet">QToolButton::setIconSet</a>( const QIconSet &amp; set )
670<li> QIconSet <a href="qtoolbutton.html#iconSet">QToolButton::iconSet</a>() const
671</ul>
672<p> Finally, this function is no longer virtual:
673<p> <ul>
674<li> void QToolButton::setIconSet( const QIconSet &amp; set, bool on )
675</ul>
676<p> If you have a class that inherits <a href="qtoolbutton.html">QToolButton</a> and that reimplements
677QToolButton::setIconSet(), you should make the signature of the
678reimplementation agree with the new <a href="qtoolbutton.html#setIconSet">QToolButton::setIconSet</a>(),
679a virtual function.
680<p> <h2> <a href="qtextstream.html">QTextStream</a>
681</h2>
682<a name="22"></a><p> The global QTextStream manipulators setw(), setfill() and setprecison()
683were renamed to qSetW(), qSetFill() and qSetPrecision() to avoid conflicts
684with <tt>&lt;iostream.h&gt;</tt>. If you used them, you must rename the occurrences to
685the new names.
686<p> <h2> <a href="qtranslator.html">QTranslator</a>
687</h2>
688<a name="23"></a><p> The <a href="qtranslator.html">QTranslator</a> class was extended in Qt 2.2, and these extensions
689lead to a new interface. This interface is used mainly by translation
690tools (for example, <a href="linguist-manual.html">Qt
691Linguist</a>). For source compatibility, no member function was
692effectively removed. The <a href="qtranslator.html">QTranslator</a> documentation points out
693which functions are obsolete.
694<p> This function is no longer virtual:
695<p> <ul>
696<li> <a href="qstring.html">QString</a> <a href="qtranslator.html#find">QTranslator::find</a>( const char * context,
697const char * sourceText ) const
698</ul>
699<p> If you have a class that inherits QTranslator and which reimplements
700QTranslator::find(), you should reimplement <a href="qtranslator.html#findMessage">QTranslator::findMessage</a>() instead.
701In fact, find() is now defined in terms of findMessage(). By doing the
702conversion, you will also gain support for translator comments and for any
703future extensions.
704<p> <h2> <a href="qwidget.html">QWidget</a>
705</h2>
706<a name="24"></a><p> <a href="qwidget.html#backgroundColor">QWidget::backgroundColor</a>(), <a href="qwidget.html#setBackgroundColor">QWidget::setBackgroundColor</a>(),
707<a href="qwidget.html#backgroundPixmap">QWidget::backgroundPixmap</a>() and <a href="qwidget.html#setBackgroundPixmap">QWidget::setBackgroundPixmap</a>() have
708often been the source of much confusion in previous releases. Qt 3.0
709addresses this by obsoleting these functions and by replacing them
710with eight new functions: <a href="qwidget.html#eraseColor">QWidget::eraseColor</a>(),
711<a href="qwidget.html#setEraseColor">QWidget::setEraseColor</a>(), <a href="qwidget.html#erasePixmap">QWidget::erasePixmap</a>(),
712<a href="qwidget.html#setErasePixmap">QWidget::setErasePixmap</a>(), <a href="qwidget.html#paletteBackgroundColor">QWidget::paletteBackgroundColor</a>(),
713<a href="qwidget.html#setPaletteBackgroundColor">QWidget::setPaletteBackgroundColor</a>(),
714<a href="qwidget.html#paletteBackgroundPixmap">QWidget::paletteBackgroundPixmap</a>() and
715<a href="qwidget.html#setPaletteBackgroundPixmap">QWidget::setPaletteBackgroundPixmap</a>(). See their documentation for
716details.
717<p> <h2> QXml Classes
718</h2>
719<a name="25"></a><p> <h3> <a href="qxmlinputsource.html">QXmlInputSource</a>
720</h3>
721<a name="25-1"></a><p> The semantics of QXmlInputSource has changed slightly. This change
722only affects code that parses the same data from the same input source
723multiple times. In such cases you must call
724<a href="qxmlinputsource.html#reset">QXmlInputSource::reset</a>() before the second call to
725<a href="qxmlsimplereader.html#parse">QXmlSimpleReader::parse</a>().
726<p> So code like
727<pre>
728 <a href="qxmlinputsource.html">QXmlInputSource</a> source( &amp;xmlFile );
729 <a href="qxmlsimplereader.html">QXmlSimpleReader</a> reader;
730 ...
731 reader.<a href="qxmlsimplereader.html#parse">parse</a>( source );
732 ...
733 reader.<a href="qxmlsimplereader.html#parse">parse</a>( source );
734</pre>
735
736must be changed to
737<pre>
738 <a href="qxmlinputsource.html">QXmlInputSource</a> source( &amp;xmlFile );
739 <a href="qxmlsimplereader.html">QXmlSimpleReader</a> reader;
740 ...
741 reader.<a href="qxmlsimplereader.html#parse">parse</a>( source );
742 ...
743 source.<a href="qxmlinputsource.html#reset">reset</a>();
744 reader.<a href="qxmlsimplereader.html#parse">parse</a>( source );
745</pre>
746
747<p> <h3> <a href="qxmllocator.html">QXmlLocator</a>
748</h3>
749<a name="25-2"></a><p> Due to some internal changes, it was necessary to clean-up the semantics of
750QXmlLocator: this class is now an abstract class. This shouldn't cause
751any problems, since programmers usually used the QXmlLocator that was
752reported by <a href="qxmlcontenthandler.html#setDocumentLocator">QXmlContentHandler::setDocumentLocator</a>(). If you used this
753class in some other way, you must adjust your code to use the
754QXmlLocator that is reported by the
755QXmlContentHandler::setDocumentLocator() function.
756<p> <h2> Asynchronous I/O Classes
757</h2>
758<a name="26"></a><p> QASyncIO, QDataSink, QDataSource, QIODeviceSource and QDataPump were
759used internally in previous versions of Qt, but are not used anymore.
760They are now obsolete.
761<p> <h2> Transparent widgets
762</h2>
763<a name="27"></a><p> In Qt 2.x, the AutoMask property was used to obtain a
764transparent-looking widget. In general, this approach is slow and
765processor hungry. Qt 3.0 uses the BackgroundOrigin which provides
766vastly improved performance and more flexibility in most cases. The
767few classes for which the AutoMask property is still the best approach
768are <a href="qcheckbox.html">QCheckBox</a>, <a href="qcombobox.html">QComboBox</a>, <a href="qpushbutton.html">QPushButton</a>, <a href="qradiobutton.html">QRadioButton</a> and <a href="qtabwidget.html">QTabWidget</a>.
769<p> <h2> Bezier Curves
770</h2>
771<a name="28"></a><p> The function names for Bezier curves in <a href="qpainter.html">QPainter</a> and <a href="qpointarray.html">QPointArray</a> have
772been corrected. They now properly reflect their cubic form instead of
773a quadratic one. If you have been using either
774QPainter::drawQuadBezier() or QPointArray::quadBezier() you must
775replace these calls with
776<ul>
777<li> void <a href="qpainter.html#drawCubicBezier">QPainter::drawCubicBezier</a>( const QPointArray &amp;, int index=0 ) and
778<li> QPointArray <a href="qpointarray.html#cubicBezier">QPointArray::cubicBezier</a>() const
779</ul>
780respectively. Neither the arguments nor the resulting curve have changed.
781<p> <h2> Locale-aware String Comparisons in <a href="qiconview.html">QIconView</a>, <a href="qlistbox.html">QListBox</a>,
782<a href="qlistview.html">QListView</a> and <a href="qtable.html">QTable</a>
783</h2>
784<a name="29"></a><p> In Qt 2.x, <a href="qstring.html">QString</a> only provided string comparisons using the Unicode
785values of the characters of a string. This is efficient and reliable,
786but it is not the appropriate order for most languages. For example,
787French users expect '&eacute;' (e acute) to be treated essentially as
788'e' and not put after 'z'.
789<p> In Qt 3.0, <a href="qstring.html#localeAwareCompare">QString::localeAwareCompare</a>() implements locale aware
790string comparisions on certain platforms. The classes <a href="qiconview.html">QIconView</a>, <a href="qlistbox.html">QListBox</a>, <a href="qlistview.html">QListView</a> and <a href="qtable.html">QTable</a> now use
791QString::localeAwareCompare() instead of <a href="qstring.html#compare">QString::compare</a>(). If you
792want to control the behaviour yourself you can always reimplement
793<a href="qiconviewitem.html#compare">QIconViewItem::compare</a>(), <a href="qlistbox.html#text">QListBox::text</a>(), <a href="qlistviewitem.html#compare">QListViewItem::compare</a>()
794or <a href="qtableitem.html#key">QTableItem::key</a>() as appropriate.
795<p>
796<!-- eof -->
797<p><address><hr><div align=center>
798<table width=100% cellspacing=0 border=0><tr>
799<td>Copyright &copy; 2007
800<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
801<td align=right><div align=right>Qt 3.3.8</div>
802</table></div></address></body>
803</html>
Note: See TracBrowser for help on using the repository browser.