[190] | 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"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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
|
---|
| 38 | means programs compiled for Qt 2.x must be recompiled to work with Qt
|
---|
| 39 | 3.x. Qt 3.x is also not completely <em>source</em> compatible with 2.x,
|
---|
| 40 | however all points of incompatibility cause compiler errors or
|
---|
| 41 | run-time messages (rather than mysterious results). Qt 3.x includes
|
---|
| 42 | many additional features and discards obsolete functionality. Porting
|
---|
| 43 | from Qt 2.x to Qt 3.x is straightforward, and once completed makes
|
---|
| 44 | the considerable additional power and flexibility of Qt 3.x available
|
---|
| 45 | for 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
|
---|
| 50 | with Qt 2.x.
|
---|
| 51 | <li> Recompile with Qt 3.x. For each error, search below for related
|
---|
| 52 | identifiers (e.g. function names, class names). This document
|
---|
| 53 | mentions all relevant identifiers to help you get the information
|
---|
| 54 | you 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
|
---|
| 56 | you'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,
|
---|
| 138 | QListView 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
|
---|
| 147 | library is static. If you just use the default configuration you
|
---|
| 148 | don't need to set certain preprocessor defines. In Qt 3.0, the
|
---|
| 149 | default configuration of the Qt library is to build it as a shared
|
---|
| 150 | library, 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
|
---|
| 152 | cause of the problem is with the project file. In the project file,
|
---|
| 153 | there 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
|
---|
| 158 | set 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
|
---|
| 163 | header files. This speeds up compilation when you don't need those
|
---|
| 164 | nested header files. But in some cases you will find you need to add
|
---|
| 165 | an extra #include to your files.
|
---|
| 166 | <p> For example, if you get a message about <a href="qstringlist.html">QStringList</a> or its functions
|
---|
| 167 | not being defined, then add <tt>#include <qstringlist.h></tt> at
|
---|
| 168 | the 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><qcursor.h></tt>
|
---|
| 172 | <li> <tt><qpainter.h></tt>
|
---|
| 173 | <li> <tt><qpen.h></tt>
|
---|
| 174 | <li> <tt><qstringlist.h></tt>
|
---|
| 175 | <li> <tt><qregexp.h></tt>
|
---|
| 176 | <li> <tt><qstrlist.h></tt>
|
---|
| 177 | <li> <tt><qstyle.h></tt>
|
---|
| 178 | <li> <tt><qvaluelist.h></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
|
---|
| 183 | left 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
|
---|
| 185 | special <a href="qt.html">Qt</a> class defined in qnamespace.h. If you get compilation
|
---|
| 186 | errors about these being missing (unlikely, since most of your code will
|
---|
| 187 | be in classes that inherit from the Qt namespace class), then apply
|
---|
| 188 | the 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
|
---|
| 208 | tried not to break source compatibility as much as possible. If you observe
|
---|
| 209 | error messages on the UNIX console or the Windows debugging stream that were
|
---|
| 210 | previously 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
|
---|
| 221 | but 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
|
---|
| 228 | have 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><iostream></tt>, the following three
|
---|
| 256 | global 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
|
---|
| 265 | documentation of each of these functions should explain how to
|
---|
| 266 | replace 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>
|
---|
| 268 | rather than the documentation supplied with Qt to obtain the latest
|
---|
| 269 | information regarding obsolete functions and how to replace them in
|
---|
| 270 | new 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> & 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><QPixmap> list, QPtrList<QPoint> 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> & foreground, const QColor & background, const QColor & light, const QColor & dark, const QColor & mid, const QColor & text, const QColor & 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> & 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> & 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 & family, const QString & style, const <a href="qstring.html">QString</a> & ) 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 & familyName, const QString & style, int pointSize, const QString & )
|
---|
| 300 | <li> <a href="qfontdatabase.html#isBitmapScalable">QFontDatabase::isBitmapScalable</a>( const QString & family, const QString & style, const QString & ) const
|
---|
| 301 | <li> <a href="qfontdatabase.html#isFixedPitch">QFontDatabase::isFixedPitch</a>( const QString & family, const QString & style, const QString & ) const
|
---|
| 302 | <li> <a href="qfontdatabase.html#isScalable">QFontDatabase::isScalable</a>( const QString & family, const QString & style, const QString & ) const
|
---|
| 303 | <li> <a href="qfontdatabase.html#isSmoothlyScalable">QFontDatabase::isSmoothlyScalable</a>( const QString & family, const QString & style, const QString & ) const
|
---|
| 304 | <li> <a href="qfontdatabase.html#italic">QFontDatabase::italic</a>( const <a href="qstring.html">QString</a> & family, const QString & style, const QString & ) const
|
---|
| 305 | <li> <a href="qfontdatabase.html#pointSizes">QFontDatabase::pointSizes</a>( const QString & family, const QString & style, const QString & )
|
---|
| 306 | <li> <a href="qfontdatabase.html#smoothSizes">QFontDatabase::smoothSizes</a>( const QString & family, const QString & style, const QString & )
|
---|
| 307 | <li> <a href="qfontdatabase.html#styles">QFontDatabase::styles</a>( const QString & family, const QString & ) const
|
---|
| 308 | <li> <a href="qfontdatabase.html#weight">QFontDatabase::weight</a>( const QString & family, const QString & style, const QString & ) 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> & 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 & 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> & caption, const QString & text, const QString & 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 & caption, const QString & text, const QString & yesButtonText = QString::null, const QString & 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 & 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> & clipRegion, const <a href="qcolorgroup.html">QColorGroup</a> & 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 & hf, int & vf, int & 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> & )
|
---|
| 359 | <li> QTabDialog::selected( const QString & 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 & str, int filemode )
|
---|
| 362 | <li> <a href="qtoolbar.html#QToolBar">QToolBar::QToolBar</a>( const QString & 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> & set, bool on )
|
---|
| 367 | <li> <a href="qtoolbutton.html#setOffIconSet">QToolButton::setOffIconSet</a>( const QIconSet & )
|
---|
| 368 | <li> <a href="qtoolbutton.html#setOnIconSet">QToolButton::setOnIconSet</a>( const QIconSet & )
|
---|
| 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> & 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> & 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> & c )
|
---|
| 379 | <li> <a href="qwidget.html#setBackgroundPixmap">QWidget::setBackgroundPixmap</a>( const <a href="qpixmap.html">QPixmap</a> & pm )
|
---|
| 380 | <li> <a href="qwidget.html#setFont">QWidget::setFont</a>( const <a href="qfont.html">QFont</a> & f, bool )
|
---|
| 381 | <li> <a href="qwidget.html#setPalette">QWidget::setPalette</a>( const <a href="qpalette.html">QPalette</a> & 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> & file )
|
---|
| 384 | <li> QXmlInputSource::QXmlInputSource( <a href="qtextstream.html">QTextStream</a> & stream )
|
---|
| 385 | <li> <a href="qxmlreader.html#parse">QXmlReader::parse</a>( const <a href="qxmlinputsource.html">QXmlInputSource</a> & 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.
|
---|
| 397 | You might have been relying on the non-portable and unpredictable behavior
|
---|
| 398 | resulting from these directives. We strongly recommend that you either make
|
---|
| 399 | use of the safe qstr* variants directly or ensure that no 0 pointer is
|
---|
| 400 | passed 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
|
---|
| 404 | and QVector have been renamed. To ease porting, the old names and the
|
---|
| 405 | old 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><qmemarray.h></tt>
|
---|
| 409 | <tr bgcolor="#d0d0d0"> <td valign="top">QCollection <td valign="top"><a href="qptrcollection.html">QPtrCollection</a> <td valign="top"><tt><qptrcollection.h></tt>
|
---|
| 410 | <tr bgcolor="#f0f0f0"> <td valign="top">QList <td valign="top"><a href="qptrlist.html">QPtrList</a> <td valign="top"><tt><qptrlist.h></tt>
|
---|
| 411 | <tr bgcolor="#d0d0d0"> <td valign="top">QListIterator <td valign="top"><a href="qptrlistiterator.html">QPtrListIterator</a> <td valign="top"><tt><qptrlist.h></tt>
|
---|
| 412 | <tr bgcolor="#f0f0f0"> <td valign="top">QQueue <td valign="top"><a href="qptrqueue.html">QPtrQueue</a> <td valign="top"><tt><qptrqueue.h></tt>
|
---|
| 413 | <tr bgcolor="#d0d0d0"> <td valign="top">QStack <td valign="top"><a href="qptrstack.html">QPtrStack</a> <td valign="top"><tt><qptrstack.h></tt>
|
---|
| 414 | <tr bgcolor="#f0f0f0"> <td valign="top">QVector <td valign="top"><a href="qptrvector.html">QPtrVector</a> <td valign="top"><tt><qptrvector.h></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.
|
---|
| 420 | This might affect programs that use QButtonGroups that contain a
|
---|
| 421 | mixture 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
|
---|
| 425 | in Qt 3.0. This is only relevant if you subclassed QDate and
|
---|
| 426 | reimplemented 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
|
---|
| 432 | QDate::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
|
---|
| 434 | been in the first place). The old names are still provided for source
|
---|
| 435 | compatibility.
|
---|
| 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
|
---|
| 439 | non-existent file, the dialog would accept this. In Qt 3.x, you must
|
---|
| 440 | set the mode, e.g. setMode(QFileDialog::AnyFile), to get the same
|
---|
| 441 | behavior.
|
---|
| 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
|
---|
| 445 | Qt 3.0, to give better Unicode support and to make developing
|
---|
| 446 | internationalized applications easier. The original API has been
|
---|
| 447 | preserved with minimal changes. The CharSet enum and its related
|
---|
| 448 | functions have disappeared. This is because Qt now handles all charset
|
---|
| 449 | related issues internally, and removes this burden from the developer.
|
---|
| 450 | <p> If you used the CharSet enum or its related functions, e.g
|
---|
| 451 | QFont::charSet() or QFont::setCharSet(), just remove them from your
|
---|
| 452 | code. There are a few functions that took a QFont::CharSet as a
|
---|
| 453 | parameter; in these cases simply remove the charset from the
|
---|
| 454 | parameter 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.
|
---|
| 458 | The <tt>echo</tt> parameter is the third parameter and defaults to
|
---|
| 459 | QLineEdit::Normal.
|
---|
| 460 | <p> If you used calls to <a href="qinputdialog.html#getText">QInputDialog::getText</a>(...) that provided more
|
---|
| 461 | than the first two required parameters you will must add a value
|
---|
| 462 | for 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><qabstractlayout.h></tt> to <tt><qlayout.h></tt>. The header <tt><qabstractlayout.h></tt> now includes <tt><qlayout.h></tt> for compatibility. It
|
---|
| 466 | might 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
|
---|
| 470 | has been dropped for Qt 3.x since GUI style is handled by the new
|
---|
| 471 | style 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
|
---|
| 475 | widget in its parent widget, including the window frame. In Qt 3.0,
|
---|
| 476 | it returns the new position of the widget, excluding window frame for
|
---|
| 477 | top 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.
|
---|
| 481 | Since Qt 3.0 includes a new richtext engine, which also supports
|
---|
| 482 | editing, QMultiLineEdit is obsolete. For the sake of compatibility
|
---|
| 483 | QMultiLineEdit is still provided. It is now a subclass of <a href="qtextedit.html">QTextEdit</a>
|
---|
| 484 | which wraps the old QMultiLineEdit so that it is mostly source
|
---|
| 485 | compatible to keep old applications working.
|
---|
| 486 | <p> For new applications and when maintaining existing applications we
|
---|
| 487 | recommend that you use QTextEdit instead of QMultiLineEdit wherever
|
---|
| 488 | possible.
|
---|
| 489 | <p> Although most of the old QMultiLineEdit API is still available, there
|
---|
| 490 | is one important difference. The old QMultiLineEdit operated in terms
|
---|
| 491 | of lines, whereas QTextEdit operates in terms of paragraphs. This is
|
---|
| 492 | because lines change all the time during wordwrap, whereas paragraphs
|
---|
| 493 | remain paragraphs. The consequence of this change is that functions
|
---|
| 494 | which previously operated on lines, e.g. numLines(), textLine(), etc.,
|
---|
| 495 | now work on paragraphs.
|
---|
| 496 | <p> Also the function getString() has been removed since it
|
---|
| 497 | published the internal data structure.
|
---|
| 498 | <p> In most cases, applications that used QMultiLineEdit will continue to
|
---|
| 499 | work without problems. Applications that worked in terms of lines may
|
---|
| 500 | require some porting.
|
---|
| 501 | <p> The source code for the old 2.x version of QMultiLineEdit can be found
|
---|
| 502 | in <tt>$QTDIR/src/attic/qtmultilineedit.h/cpp</tt>. Note that the class has
|
---|
| 503 | been renamed to QtMultiLineEdit to avoid name clashes. If you really
|
---|
| 504 | need to keep compatibility with the old QMultiLineEdit, simply include
|
---|
| 505 | this class in your project and rename QMultiLineEdit to
|
---|
| 506 | QtMultiLineEdit 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
|
---|
| 510 | to ensure it has the same runtime behaviour on both Unix and Windows. In 2.x,
|
---|
| 511 | QPrinter behaved differently on Windows and Unix, when using view
|
---|
| 512 | transformations on the <a href="qpainter.html">QPainter</a>. This has changed now, and QPrinter
|
---|
| 513 | behaves consistently across all platforms. A compatibilty mode has been
|
---|
| 514 | added that forces the old behaviour, to ease porting from Qt 2.x
|
---|
| 515 | to Qt 3.x. This compatibilty mode can be enabled by passing the
|
---|
| 516 | QPrinter::Compatible flag to the QPrinter constructor.
|
---|
| 517 | <p> On X11, QPrinter used to generate encapsulated postscript when
|
---|
| 518 | fullPage() was TRUE and only one page was printed. This does not
|
---|
| 519 | happen 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
|
---|
| 523 | regular expressions. Both the <a href="qregexp.html#regular-expression">regular expression</a> syntax and the QRegExp
|
---|
| 524 | interface have been modified.
|
---|
| 525 | <p> Be also aware that <tt><qregexp.h></tt> is no longer included
|
---|
| 526 | automatically when you include <tt><qstringlist.h></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
|
---|
| 533 | regular expressions, you must add <tt>\</tt> (backslash) in front of any
|
---|
| 534 | of these (actually, <tt>\\</tt> in C++ strings), unless it is already
|
---|
| 535 | there.
|
---|
| 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 |
|
---|
| 541 | should 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
|
---|
| 547 | characters, 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 |
|
---|
| 559 | However, when they are used, make sure to use <a href="qregexp.html#exactMatch">QRegExp::exactMatch</a>()
|
---|
| 560 | rather than the obsolete <a href="qregexp.html#match">QRegExp::match</a>(). QRegExp::match(), like
|
---|
| 561 | QRegExp::find(), tries to find a match somewhere in the target
|
---|
| 562 | string, while QRegExp::exactMatch() tries to match the whole target
|
---|
| 563 | string.
|
---|
| 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.
|
---|
| 567 | Old 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 |
|
---|
| 575 | still compiles with Qt 3, but produces a different result (the case sensitivity
|
---|
| 576 | and wildcard options are forgotten). This way,
|
---|
| 577 | <pre>
|
---|
| 578 | rx = "beta";
|
---|
| 579 | </pre>
|
---|
| 580 |
|
---|
| 581 | is the same as
|
---|
| 582 | <pre>
|
---|
| 583 | rx = QRegExp( "beta" );
|
---|
| 584 | </pre>
|
---|
| 585 |
|
---|
| 586 | which 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
|
---|
| 590 | parameter 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> & str, int index = 0,
|
---|
| 593 | int * len = 0, bool indexIsStart = TRUE ) const
|
---|
| 594 | </ul>
|
---|
| 595 | It 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
|
---|
| 599 | name 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
|
---|
| 603 | between 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 |
|
---|
| 609 | returns 1 in Qt 2.0; it returns 0 in Qt 3.0. Also, "^" now really means
|
---|
| 610 | start of input, so
|
---|
| 611 | <pre>
|
---|
| 612 | QString( "Heisan Hoppsan" ).contains( QRegExp("^.*$") )
|
---|
| 613 | </pre>
|
---|
| 614 |
|
---|
| 615 | returns 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>
|
---|
| 620 | as 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 |
|
---|
| 626 | With Qt 3.0, the compiler gives an error. The solution is to use a
|
---|
| 627 | QRegExp cast:
|
---|
| 628 | <pre>
|
---|
| 629 | text.replace( QRegExp("[A-Z]+"), "" );
|
---|
| 630 | </pre>
|
---|
| 631 |
|
---|
| 632 | This change makes it possible to introduce a
|
---|
| 633 | QString::replace(QString, QString) overload in a future version of Qt
|
---|
| 634 | without 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
|
---|
| 638 | modal 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>
|
---|
| 642 | or 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
|
---|
| 646 | Qt 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
|
---|
| 648 | view for compatibility you can find it in <tt>$QTDIR/src/attic/qttableview.{cpp,h}</tt>. Note that the class has been
|
---|
| 649 | renamed from QTableView to QtTableView to avoid name clashes. To use
|
---|
| 650 | it, simply include it in your project and rename QTableView to
|
---|
| 651 | QtTableView 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"
|
---|
| 655 | icons. 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>
|
---|
| 658 | properties are still provided so that old source will compile, but
|
---|
| 659 | their 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
|
---|
| 660 | need 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 & 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
|
---|
| 667 | should use the following instead:
|
---|
| 668 | <p> <ul>
|
---|
| 669 | <li> void <a href="qtoolbutton.html#setIconSet">QToolButton::setIconSet</a>( const QIconSet & 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 & set, bool on )
|
---|
| 675 | </ul>
|
---|
| 676 | <p> If you have a class that inherits <a href="qtoolbutton.html">QToolButton</a> and that reimplements
|
---|
| 677 | QToolButton::setIconSet(), you should make the signature of the
|
---|
| 678 | reimplementation agree with the new <a href="qtoolbutton.html#setIconSet">QToolButton::setIconSet</a>(),
|
---|
| 679 | a 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()
|
---|
| 683 | were renamed to qSetW(), qSetFill() and qSetPrecision() to avoid conflicts
|
---|
| 684 | with <tt><iostream.h></tt>. If you used them, you must rename the occurrences to
|
---|
| 685 | the 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
|
---|
| 689 | lead to a new interface. This interface is used mainly by translation
|
---|
| 690 | tools (for example, <a href="linguist-manual.html">Qt
|
---|
| 691 | Linguist</a>). For source compatibility, no member function was
|
---|
| 692 | effectively removed. The <a href="qtranslator.html">QTranslator</a> documentation points out
|
---|
| 693 | which 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,
|
---|
| 697 | const char * sourceText ) const
|
---|
| 698 | </ul>
|
---|
| 699 | <p> If you have a class that inherits QTranslator and which reimplements
|
---|
| 700 | QTranslator::find(), you should reimplement <a href="qtranslator.html#findMessage">QTranslator::findMessage</a>() instead.
|
---|
| 701 | In fact, find() is now defined in terms of findMessage(). By doing the
|
---|
| 702 | conversion, you will also gain support for translator comments and for any
|
---|
| 703 | future 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
|
---|
| 708 | often been the source of much confusion in previous releases. Qt 3.0
|
---|
| 709 | addresses this by obsoleting these functions and by replacing them
|
---|
| 710 | with 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
|
---|
| 716 | details.
|
---|
| 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
|
---|
| 722 | only affects code that parses the same data from the same input source
|
---|
| 723 | multiple 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( &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 |
|
---|
| 736 | must be changed to
|
---|
| 737 | <pre>
|
---|
| 738 | <a href="qxmlinputsource.html">QXmlInputSource</a> source( &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
|
---|
| 750 | QXmlLocator: this class is now an abstract class. This shouldn't cause
|
---|
| 751 | any problems, since programmers usually used the QXmlLocator that was
|
---|
| 752 | reported by <a href="qxmlcontenthandler.html#setDocumentLocator">QXmlContentHandler::setDocumentLocator</a>(). If you used this
|
---|
| 753 | class in some other way, you must adjust your code to use the
|
---|
| 754 | QXmlLocator that is reported by the
|
---|
| 755 | QXmlContentHandler::setDocumentLocator() function.
|
---|
| 756 | <p> <h2> Asynchronous I/O Classes
|
---|
| 757 | </h2>
|
---|
| 758 | <a name="26"></a><p> QASyncIO, QDataSink, QDataSource, QIODeviceSource and QDataPump were
|
---|
| 759 | used internally in previous versions of Qt, but are not used anymore.
|
---|
| 760 | They 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
|
---|
| 764 | transparent-looking widget. In general, this approach is slow and
|
---|
| 765 | processor hungry. Qt 3.0 uses the BackgroundOrigin which provides
|
---|
| 766 | vastly improved performance and more flexibility in most cases. The
|
---|
| 767 | few classes for which the AutoMask property is still the best approach
|
---|
| 768 | are <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
|
---|
| 772 | been corrected. They now properly reflect their cubic form instead of
|
---|
| 773 | a quadratic one. If you have been using either
|
---|
| 774 | QPainter::drawQuadBezier() or QPointArray::quadBezier() you must
|
---|
| 775 | replace these calls with
|
---|
| 776 | <ul>
|
---|
| 777 | <li> void <a href="qpainter.html#drawCubicBezier">QPainter::drawCubicBezier</a>( const QPointArray &, int index=0 ) and
|
---|
| 778 | <li> QPointArray <a href="qpointarray.html#cubicBezier">QPointArray::cubicBezier</a>() const
|
---|
| 779 | </ul>
|
---|
| 780 | respectively. 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
|
---|
| 785 | values of the characters of a string. This is efficient and reliable,
|
---|
| 786 | but it is not the appropriate order for most languages. For example,
|
---|
| 787 | French users expect 'é' (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
|
---|
| 790 | string 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
|
---|
| 791 | QString::localeAwareCompare() instead of <a href="qstring.html#compare">QString::compare</a>(). If you
|
---|
| 792 | want 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>()
|
---|
| 794 | or <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 © 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>
|
---|