Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
This document describes the process of porting applications from Qt 3 to Qt 4. If you haven't yet made the decision about porting, or are unsure about whether it is worth it, take a look at the key features offered by Qt 4. See also Moving from Qt 3 to Qt 4 for tips on how to write Qt 3 code that is easy to port to Qt 4.
Other porting guides:
The Qt 4 series is not binary compatible with the 3 series. This means programs compiled for Qt 3 must be recompiled to work with Qt 4. Qt 4 is also not completely source compatible with 3, however nearly all points of incompatibility cause compiler errors or run-time messages (rather than mysterious results). Qt 4 includes many additional features and discards obsolete functionality. Porting from Qt 3 to Qt 4 requires some effort, but once completed the considerable additional power and flexibility of Qt 4 is available for use in your applications.
To port code from Qt 3 to Qt 4:
The qt3to4 porting tool replaces occurrences of Qt 3 classes that don't exist anymore in Qt 4 with the corresponding Qt 3 support class; for example, QListBox is turned into Q3ListBox.
At some point, you might want to stop linking against the Qt 3 support library (Qt3Support) and take advantage of Qt 4's new features. The instructions below explain how to do that for each compatibility class.
In addition to the Qt3Support classes (such as Q3Action, Q3ListBox, and Q3ValueList), Qt 4 provides compatibility functions when it's possible for an old API to cohabit with the new one. For example, QString provides a QString::simplifyWhiteSpace() compatibility function that's implemented inline and that simply calls QString::simplified(). The compatibility functions are not documented here; instead, they are documented for each class.
If you have the line QT += qt3support in your .pro file, qmake will automatically define the QT3_SUPPORT symbol, turning on compatibility function support. You can also define the symbol manually (e.g., if you don't want to link against the Qt3Support library), or you can define QT3_SUPPORT_WARNINGS instead, telling the compiler to emit a warning when a compatibility function is called. (This works only with GCC 3.2+ and MSVC 7.)
If you get stuck, ask on the qt-interest mailing list. If you are a licensed customer, you can also contact Trolltech support.
Table of contents:
In Qt 3, it was possible to use the qt_cast() function to determine whether instances of QObject subclasses could be safely cast to derived types of those subclasses. For example, if a QFrame instance is passed to a function whose signature specifies a QWidget pointer as its argument, qt_cast() could be used to obtain a QFrame pointer so that the instance's functions can be accessed.
In Qt 4, much of this functionality is provided by the qobject_cast() function, and additional functions also provide similar functionality for certain non-QObject types:
Qt 3 function | Qt 4 function |
---|---|
T *qt_cast<T *>(QObject *) | T *qobject_cast<T *>(QObject *) |
T qgraphicsitem_cast<T>(QGraphicsItem *) | |
T qstyleoption_cast<T>(QStyleOption *) | |
T qvariant_cast<T>(const QVariant &) | |
T qdbus_cast(const QDBusArgument &) |
The table below lists the classes that have been renamed in Qt 4. If you compile your applications with QT3_SUPPORT defined, the old names will be available.
Whenever you see an occurrence of the name on the left, you can safely replace it with the Qt 4 equivalent in your program. The qt3to4 tool performs the conversion automatically.
Qt 3 class name | Qt 4 class name |
---|---|
QIconSet | QIcon |
QWMatrix | QMatrix |
QGuardedPtr | QPointer |
The table below lists the enums and typedefs that have been renamed in Qt 4. If you compile your applications with QT3_SUPPORT defined, the old names will be available.
Whenever you see an occurrence of the name on the left, you can safely replace it with the Qt 4 equivalent in your program. The qt3to4 tool performs the conversion automatically.
Qt 3 type name | Qt 4 type name |
---|---|
QApplication::ColorMode | QApplication::ColorSpec |
QButton::ToggleState | QCheckBox::ToggleState |
QCursorShape | Qt::CursorShape |
QFile::FilterSpec | QFile::Filters |
QFile::PermissionSpec | QFile::Permission |
QFile::SortSpec | QFile::SortFlags |
QFile::Status | QFile::Error |
QFileInfo::PermissionSpec | QFile::Permission |
QGrid::Direction | Qt::Orientation |
QGridWidget::Direction | Qt::Orientation |
QIODevice::Offset | qlonglong |
QImage::ScaleMode | Qt::AspectRatioMode |
QSize::ScaleMode | Qt::AspectRatioMode |
QSocket::Error | Q3Socket::Error |
QSocket::State | Q3Socket::State |
QStyle::SCFlags | QStyle::SubControls |
QStyle::SFlags | QStyle::State |
QTS | QTextStream |
QUrlDrag | QUriDrag |
QWidget::FocusPolicy | Qt::FocusPolicy |
Q_LLONG | qlonglong |
Q_ULLONG | qulonglong |
Qt::Dock | Qt::ToolBarDock |
Qt::MacintoshVersion | QSysInfo::MacVersion |
Qt::TextFlags | Qt::TextFlag |
Qt::WindowsVersion | QSysInfo::WinVersion |
The table below lists the enum values that have been renamed in Qt 4. If you compile your applications with QT3_SUPPORT defined, the old names will be available.
Whenever you see an occurrence of the name on the left, you can safely replace it with the Qt 4 equivalent in your program. The qt3to4 tool performs the conversion automatically.
In addition, the following window flags have been either replaced with widget attributes or have been deprecated:
Qt 3 type | Qt 4 equivalent |
---|---|
Qt::WDestructiveClose | Use QWidget::setAttribute(Qt::WA_DeleteOnClose) instead. |
Qt::WStaticContents | Use QWidget::setAttribute(Qt::WA_StaticContents) instead. |
Qt::WNorthWestGravity | |
Qt::WNoAutoErase | Use QWidget::setAttribute(Qt::WA_NoBackground) instead. |
Qt::WResizeNoErase | |
Qt::WRepaintNoErase | |
Qt::WPaintClever | Unnecessary in Qt 4. |
Qt::WMacNoSheet | Unnecessary in Qt 4. |
In Qt 4.1, the widget flags used to determine window modality were replaced by a single enum that can be used to specify the modal behavior of top-level widgets:
Qt 3 type | Qt 4 equivalent |
---|---|
Qt::WShowModal | Use QWidget::setWindowModality(Qt::ApplicationModal) instead. |
Qt::WGroupLeader | Use QWidget::setWindowModality(Qt::WindowModal) for each child dialog of the group leader, but do not change the modality of the group leader itself. |
Some properties have been renamed in Qt 4, to make Qt's API more consistent and more intuitive. For example, QWidget's caption property has been renamed windowTitle to make it clear that it refers to the title shown in the window's title bar.
In addition, the property system has been extended to allow properties to be redefined in subclasses with the Q_PROPERTY() macro, removing the need for a Q_OVERRIDE() macro.
The table below lists the Qt properties that have been renamed in Qt 4. Occurrences of these in Qt Designer .ui files are automatically converted to the new name by uic.
Qt 3 name | Qt 4 name |
---|---|
QButton::accel | QButton::shortcut |
QButton::on | QButton::checked |
QButton::toggleButton | QAbstractButton::checkable |
QDial::lineStep | QDial::singleStep |
QDial::maxValue | QDial::maximum |
QDial::minValue | QDial::minimum |
QDialog::modal | QDialog::isModal |
QLineEdit::edited | QLineEdit::modified |
QLineEdit::hasMarkedText | QLineEdit::hasSelectedText |
QLineEdit::markedText | QLineEdit::selectedText |
QObject::name | QObject::objectName |
QProgressDialog::progress | QProgressDialog::value |
QProgressDialog::totalSteps | QProgressDialog::maximum |
QProgressDialog::wasCancelled | QProgressDialog::wasCanceled |
QPushButton::iconSet | QPushButton::icon |
QScrollBar::draggingSlider | QScrollBar::sliderDown |
QScrollBar::lineStep | QScrollBar::singleStep |
QScrollBar::maxValue | QScrollBar::maximum |
QScrollBar::minValue | QScrollBar::minimum |
QSlider::lineStep | QSlider::singleStep |
QSlider::maxValue | QSlider::maximum |
QSlider::minValue | QSlider::minimum |
QSpinBox::lineStep | QSpinBox::singleStep |
QSpinBox::maxValue | QSpinBox::maximum |
QSpinBox::minValue | QSpinBox::minimum |
QTabBar::currentTab | QTabBar::currentIndex |
QTabWidget::currentPage | QTabWidget::currentWidget |
QToolButton::iconSet | QToolButton::icon |
QToolButton::textLabel | QToolButton::text |
QWidget::caption | QWidget::windowTitle |
QWidget::icon | QWidget::windowIcon |
QWidget::iconText | QWidget::windowIconText |
A handful of properties in Qt 3 are no longer properties in Qt 4, but the access functions still exist as part of the Qt 4 API. These are not used by Qt Designer; the only case where you need to worry about them is in highly dynamic applications that use Qt's meta-object system to access properties. Here's the list of these properties with the read and write functions that you can use instead:
Qt 3 property | Qt 4 read function | Qt 4 write function |
---|---|---|
QSqlDatabase::connectOptions | QSqlDatabase::connectOptions() | QSqlDatabase::setConnectOptions() |
QSqlDatabase::databaseName | QSqlDatabase::databaseName() | QSqlDatabase::setDatabaseName() |
QSqlDatabase::hostName | QSqlDatabase::hostName() | QSqlDatabase::setHostName() |
QSqlDatabase::password | QSqlDatabase::password() | QSqlDatabase::setPassword() |
QSqlDatabase::port | QSqlDatabase::port() | QSqlDatabase::setPort() |
QSqlDatabase::userName | QSqlDatabase::userName() | QSqlDatabase::setUserName() |
Some properties have been removed from Qt 4, but the associated access functions are provided if QT3_SUPPORT is defined to help porting to Qt 4. When converting Qt 3 .ui files to Qt 4, uic generates calls to the Qt 3 compatibility functions. Note that this only applies to the properties of the Qt3Support library, i.e. QT3_SUPPORT properties of the other libraries must be ported manually when converting Qt 3 .ui files to Qt 4.
The table below lists these properties with the read and write functions that you can use instead. The documentation for the individual functions explains how to replace them with non-compatibility Qt 4 functions.
Qt 3 property | Qt 4 read function (QT3_SUPPORT) | Qt 4 write function (QT3_SUPPORT) |
---|---|---|
QMenuBar::separator | QMenuBar::separator() | QMenuBar::setSeparator() |
QPushButton::menuButton | QPushButton::isMenuButton() | N/A |
QTabWidget::margin | QTabWidget::margin() | QTabWidget::setMargin() |
QTextEdit::textFormat | QTextEdit::textFormat() | QTextEdit::setTextFormat() |
QWidget::backgroundBrush | QWidget::backgroundBrush() | N/A |
QWidget::backgroundMode | QWidget::backgroundMode() | QWidget::setBackgroundMode() |
QWidget::backgroundOrigin | QWidget::backgroundOrigin() | QWidget::setBackgroundOrigin() |
QWidget::colorGroup | QWidget::colorGroup() | QWidget::setColorGroup() |
QWidget::customWhatsThis | QWidget::customWhatsThis() | QWidget::setCustomWhatsThis() |
QWidget::inputMethodEnabled | QWidget::inputMethodEnabled() | QWidget::setInputMethodEnabled() |
QWidget::ownCursor | QWidget::ownCursor() | N/A |
QWidget::ownFont | QWidget::ownFont() | N/A |
QWidget::ownPalette | QWidget::ownPalette() | N/A |
QWidget::paletteBackgroundColor | QWidget::paletteBackgroundColor() | QWidget::setPaletteBackgroundColor() |
QWidget::paletteBackgroundPixmap | QWidget::paletteBackgroundPixmap() | QWidget::setPaletteBackgroundPixmap() |
QWidget::paletteForegroundColor | QWidget::paletteForegroundColor() | QWidget::setPaletteForegroundColor() |
QWidget::underMouse | QWidget::underMouse() | N/A |
The following Qt 3 properties and their access functions are no longer available in Qt 4. In most cases, Qt 4 provides similar functionality.
Qt 3 property | Qt 4 equivalent |
---|---|
QButton::autoRepeat | N/A |
QButton::autoResize | Call QWidget:setFixedSize(QWidget::sizeHint()) whenever you change the contents. |
QButton::exclusiveToggle | See QAbstractButton::autoExclusive. |
QButton::pixmap | Use QAbstractButton::icon instead. |
QButton::toggleState | Use QCheckBox::setState() and QCheckBox::state() instead. |
QButton::toggleType | Use QCheckBox::setTristate() instead. |
QComboBox::autoResize | Call QWidget:setFixedSize(QWidget::sizeHint()) whenever you change the contents. |
QFrame::contentsRect | Use Q3Frame::contentsRect() instead. |
QFrame::margin | Use QWidget::setContentsMargins() instead. |
QTabBar::keyboardFocusTab | N/A |
QToolButton::offIconSet | Use the off component of QAbstractButton::icon instead. |
QToolButton::onIconSet | Use the on component of QAbstractButton::icon instead. |
QWidget::microFocusHint | N/A |
Qt 4 is the first version of Qt that contains no explicitly shared classes. All classes that were explicitly shared in Qt 3 are implicitly shared in Qt 4:
This means that if you took a copy of an instance of the class (using operator=() or the class's copy constructor), any modification to the copy would affect the original and vice versa. Needless to say, this behavior is rarely desirable.
Fortunately, nearly all Qt 3 applications don't rely on explicit sharing. When porting, you typically only need to remove calls to detach() and/or copy(), which aren't necessary anymore.
If you deliberately rely on explicit sharing in your application, you can use pointers or references to achieve the same result in Qt 4.
For example, if you have code like
void asciify(QByteArray array) { for (int i = 0; i < (int)array.size(); ++i) { if ((uchar)array[i] >= 128) array[i] = '?'; } }
you can rewrite it as
void asciify(QByteArray &array) { for (int i = 0; i < array.size(); ++i) { if ((uchar)array[i] >= 128) array[i] = '?'; } }
(Notice the & in the parameter declaration.)
When implementing custom widgets in Qt 3, it was possible to use QPainter to draw on a widget outside paint events. This made it possible to integrate Qt applications with third party libraries and tools that impose their own rendering models. For example, a widget might be repainted in a slot using data obtained from an external source.
In Qt 4, it is only possible to paint on a widget from within its paintEvent() handler function. This restriction simplifies Qt's interaction with native window systems, improves the performance of applications by reducing the number of redraw operations, and also enables features to be implemented to improve the appearance of widgets, such as a backing store.
Generally, we recommend redesigning applications to perform all painting operations in paintEvent() functions, deferring actual painting until the next time this function is called. Applications can post paint events to trigger repaints, and it may be possible to examine your widget's internal state to determine which part of the widget needs to be repainted.
If asynchronous repaints are used extensively by your application, and it is not practical to redesign the rendering model to perform all painting operations from within a widget's paintEvent() function, it may be necessary to consider using an intermediate painting step. In this approach, one or more images can be updated asynchronously and painted on the widget in the paint event. To avoid excessive buffering, it may be worthwhile disabling the backing store by setting the widget's Qt::WA_PaintOnScreen widget attribute.
On certain platforms, the Qt::WA_PaintOutsidePaintEvent widget attribute can be set to allow a widget to be painted from outside paint events.
Note: Setting widget attributes to disable key features of Qt's widget rendering model may also cause other features to be disabled.
The QAccel class has been renamed Q3Accel and moved to the Qt3Support module. In new applications, you have three options:
The Q3Accel class also supports multiple accelerators using the same object, by calling Q3Accel::insertItem() multiple times. In Qt 4, the solution is to create multiple QShortcut objects.
The QAccessibleInterface class has undergone some API changes in Qt 4, to make it more consistent with the rest of the Qt API.
If you have classes that inherit QAccessibleInterface or one of its subclasses (QAccessibleObject, QAccessibleWidget, etc.), you must port them the new QAccessibleInterface API.
See Virtual Functions for a list of QAccessibleInterface virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QAccessibleTitleBar has been renamed Q3AccessibleTitleBar and moved to the Qt3Support library.
The QAction class has been redesigned in Qt 4 to integrate better with the rest of the menu system. It unifies the old QMenuItem class and the old QAction class into one class, avoiding unnecessary data duplication and the need to learn two different APIs.
The old QAction and QActionGroup classes have been renamed Q3Action and Q3ActionGroup and moved to Qt3Support. In addition, the new QAction class has compatibility functions to ease transition to Qt 4. Note that when using Q3ToolBar and Q3PopupMenu, their actions must be Q3Actions.
See Virtual Functions for a list of QAction virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QAction class has been completely redesigned in Qt 4 to integrate better with the rest of the menu system. See the section on QAction for details.
The QApplication class has been split into two classes: QCoreApplication and QApplication. The new QApplication class inherits QCoreApplication and adds GUI-related functionality. In practice, this has no consequences for existing Qt applications.
In addition, the following API changes were made:
Also, QWidgetList has changed from being a typedef for QPtrList<QWidget> to being a typedef for QList<QWidget *>. See the section on QWidgetList below for details.
For example, if you have code like
QWidgetList *list = QApplication::topLevelWidgets(); QWidgetListIt it(*list); QWidget *widget; while ((widget = it.current())) { if (widget->inherits("MainWindow")) ((MainWindow *)widget)->updateRecentFileItems(); ++it; } delete list;
you can rewrite it as
QWidgetList list = QApplication::topLevelWidgets(); for (int i = 0; i < list.size(); ++i) { if (MainWindow *mainWin = qobject_cast<MainWindow>(list.at(i))) mainWin->updateRecentFileItems(); }
The QAquaStyle class first appeared in Qt 3.0, when the Qt/Mac port was first released. It emulated Apple's "Aqua" theme. In Qt 3.1, QAquaStyle was obsoleted by QMacStyle, which uses Appearance Manager to perform its drawing.
The QAquaStyle class is no longer provided in Qt 4. Use QMacStyle instead.
QAsciiCache<T> has been renamed Q3AsciiCache<T> and moved to the Qt3Support library. It has been replaced by QCache<QByteArray, T>.
For details, read the section on QCache<T>, mentally substituting QByteArray for QString.
QAsciiDict<T> and QAsciiDictIterator<T> have been renamed Q3AsciiDict<T> and Q3AsciiDictIterator<T> and moved to the Qt3Support library. They have been replaced by the more modern QHash<Key, T> and QMultiHash<Key, T> classes and their associated iterator classes.
When porting old code that uses Q3AsciiDict<T> to Qt 4, there are four classes that you can use:
For details, read the section on QDict<T>, mentally substituting QByteArray for QString.
The QAsyncIO class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0.
If you use this mechanism in your application, please submit a report to the Task Tracker on the Trolltech website and we will try to find a satisfactory substitute.
The undocumented QBackInsertIterator class has been removed from the Qt library. If you need it in your application, feel free to copy the source code from the Qt 3 <qtl.h> header file.
In Qt 3, QBitArray inherited from QByteArray. In Qt 4, QBitArray is a totally independent class. This makes very little difference to the user, except that the new QBitArray doesn't provide any of QByteArray's byte-based API anymore. These calls will result in a compile-time error, except calls to QBitArray::truncate(), whose parameter was a number of bytes in Qt 3 and a number of bits in Qt 4.
QBitArray was an explicitly shared class in Qt 3. See Explicit Sharing for more information.
The QBitVal class has been renamed QBitRef.
The QButton class has been replaced by QAbstractButton in Qt 4. Classes like QPushButton and QRadioButton inherit from QAbstractButton. As a help when porting older Qt applications, the Qt3Support library contains a Q3Button class implemented in terms of the new QAbstractButton.
If you used the QButton class as a base class for your own button type and want to port your code to the newer QAbstractButton, you need to be aware that QAbstractButton has no equivalent for the Q3Button::drawButton(QPainter *) virtual function. The solution is to reimplement QWidget::paintEvent() in your QAbstractButton subclass as follows:
void MyButton::paintEvent(QPaintEvent *) { QPainter painter(this); drawButton(&painter); }
Q3Button function | QAbstractButton equivalent |
---|---|
Q3Button::autoResize() | Call QWidget:setFixedSize(QWidget::sizeHint()) whenever you change the contents. |
Q3Button::isExclusiveToggle() | Use QAbstractButton::group() or QAbstractButton::autoExclusive() instead. |
Q3Button::pixmap() const | QAbstractButton::icon() |
Q3Button::setAutoResize() | N/A |
Q3Button::setPixmap(const QPixmap &) | QAbstractButton::setIcon(const QIcon &) |
Q3Button::setState(ToggleState) | See remark below |
Q3Button::setToggleType(ToggleType) | See remark below |
Q3Button::state() | See remark below |
Q3Button::stateChanged(int) | See remark below |
Q3Button::toggleType() | See remark below |
Remarks:
See Virtual Functions for a list of QButton virtual member functions in Qt 3 that aren't virtual in Qt 4.
See Properties for a list of QButton properties in Qt 3 that have changed in Qt 4.
The QButtonGroup class has been completely redesigned in Qt 4. For compatibility, the old QButtonGroup class has been renamed Q3ButtonGroup and has been moved to Qt3Support. Likewise, the QHButtonGroup and QVButtonGroup convenience subclasses have been renamed Q3HButtonGroup and Q3VButtonGroup and moved to the Qt3Support library.
The old QButtonGroup, as well as Q3ButtonGroup, can be used in two ways:
Unlike Q3ButtonGroup, the new QButtonGroup doesn't inherit QWidget. It is very similar to a "hidden Q3ButtonGroup".
If you use a Q3ButtonGroup, Q3HButtonGroup, or Q3VButtonGroup as a widget and want to port to Qt 4, you can replace it with QGroupBox. In Qt 4, radio buttons with the same parent are automatically part of an exclusive group, so you normally don't need to do anything else. See also the section on QGroupBox below.
See Virtual Functions for a list of QButtonGroup virtual member functions in Qt 3 that are no longer virtual in Qt 4.
In Qt 3, QByteArray was simply a typedef for QMemArray<char>. In Qt 4, QByteArray is a class in its own right, with a higher-level API in the style of QString.
Here are the main issues to be aware of when porting to Qt 4:
For example, if you have code like
QByteArray ba(64);
you can rewrite it as
QByteArray ba(64, '\0');
ba.at(0) = 'X';
will no longer compile. Instead, use QByteArray::operator[]:
ba[0] = 'X';
QByteArray was an explicitly shared class in Qt 3. See Explicit Sharing for more information.
QCache<T> has been renamed Q3Cache<T> and moved to Qt3Support. The new QCache class has a different API, and takes different template parameters: QCache<Key, T>.
When porting to Qt 4, QCache<QString, T> is the obvious substitute for Q3Cache<T>. The following table summarizes the API differences.
Q3Cache<T> function | QCache<QString, T> equivalent |
---|---|
Q3Cache::Q3Cache(int maxCost, int size, bool caseSensitive) | See remark below |
Q3Cache::autoDelete() | N/A |
Q3Cache::count() | QCache::count() or QCache::size() (equivalent) |
Q3Cache::setAutoDelete() | See remark below |
Q3Cache::size() | N/A |
Q3Cache::statistics() | N/A |
Q3Cache::operator=() | See remark below |
Remarks:
if (!cache.insert(key, object)) delete object;
becomes
cache.insert(key, object);
Q3Cache<QWidget> cache; cache.insert(widget->name(), widget); ... QWidget *foo = cache.take("foo"); if (foo) foo->show();
becomes
typedef QWidget *QWidgetPtr; QCache<QString, QWidgetPtr> cache; cache.insert(widget->name(), new QWidgetPtr(widget)); ... QWidgetPtr *ptr = cache.take("foo"); if (ptr) { QWidget *foo = *ptr; delete ptr; foo->show(); }
An alternative is to stick to using Q3Cache.
QCacheIterator<T> has been renamed Q3CacheIterator<T> and moved to the Qt3Support library. The new QCache class doesn't offer any iterator types.
The canvas module classes have been renamed and moved to the Qt3Support library.
Qt 3 class name | Compatibility class in Qt 4 |
---|---|
QCanvas | Q3Canvas |
QCanvasEllipse | Q3CanvasEllipse |
QCanvasItem | Q3CanvasItem |
QCanvasItemList | Q3CanvasItemList |
QCanvasLine | Q3CanvasLine |
QCanvasPixmap | Q3CanvasPixmap |
QCanvasPixmapArray | Q3CanvasPixmapArray |
QCanvasPolygon | Q3CanvasPolygon |
QCanvasPolygonalItem | Q3CanvasPolygonalItem |
QCanvasRectangle | Q3CanvasRectangle |
QCanvasSpline | Q3CanvasSpline |
QCanvasSprite | Q3CanvasSprite |
QCanvasText | Q3CanvasText |
QCanvasView | Q3CanvasView |
The Graphics View Framework replaces QCanvas. For more on porting to Graphics View, see Porting to Graphics View.
In Qt 4, QColor is a value type like QPoint or QRect. Graphics system-specific code has been implemented in QColormap.
The QColor::maxColors() function has been replaced by QColormap::size().
The QColor::numBitPlanes() function has been replaced by QColormap::depth().
The predefined colors listed in the table above were static QColor objects in Qt 3. In Qt 4, they are enum values of type Qt::GlobalColor. Thanks to the implicit QColor(Qt::GlobalColor) constructor, the enum values are automatically converted to QColors in most contexts. Occasionally, you might need a cast.
For example, if you have code like
QColor lightCyan = Qt::cyan.light(180);
you can rewrite it as
QColor lightCyan = QColor(Qt::cyan).light(180);
In Qt 3, a QPalette consisted of three QColorGroup objects. In Qt 4, the (rarely used) QColorGroup abstraction has been eliminated. For source compatibility, a QColorGroup class is available when QT3_SUPPORT is defined.
The new QPalette still works in terms of color groups, specified through enum values (QPalette::Active, QPalette::Disabled, and QPalette::Inactive). It also has the concept of a current color group, which you can set using QPalette::setCurrentColorGroup().
The QPalette object returned by QWidget::palette() returns a QPalette initialized with the correct current color group for the widget. This means that if you had code like
painter.setBrush(colorGroup().brush(QColorGroup::Text));
you can simply replace colorGroup() with palette():
painter.setBrush(palette().brush(QPalette::Text));
The QColorDrag class has been renamed Q3ColorDrag and moved to the Qt3Support library. In Qt 4, use QMimeData instead and call QMimeData::setColor() to set the color.
In Qt 3, the list box used to display the contents of a QComboBox widget could be accessed by using the listBox() function. In Qt 4, the standard list box is provided by a QListView widget, and can be accessed with the view() function.
See Virtual Functions for a list of QComboBox virtual member functions in Qt 3 that are no longer virtual in Qt 4.
In Qt 3, QCString inherited from QByteArray. The main drawback of this approach is that the user had the responsibility of ensuring that the string is '\0'-terminated. Another important issue was that conversions between QCString and QByteArray often gave confusing results. (See the Achtung! Binary and Character Data article in Qt Quarterly for an overview of the pitfalls.)
Qt 4 solves that problem by merging the QByteArray and QCString classes into one class called QByteArray. Most functions that were in QCString previously have been moved to QByteArray. The '\0' issue is handled by having QByteArray allocate one extra byte that it always sets to '\0'. For example:
QByteArray ba("Hello"); ba.size(); // returns 5 (the '\0' is not counted) ba.length(); // returns 5 ba.data()[5]; // returns '\0'
The Qt3Support library contains a class called Q3CString that inherits from the new QByteArray class and that extends it to provide an API that is as close to the old QCString class as possible. Note that the following functions aren't provided by Q3CString:
The following functions have lost their last parameter, which specified whether the search was case sensitive or not:
In both cases, the solution is to convert the QCString to a QString and use the corresponding QString functions instead.
Also be aware that QCString::size() (inherited from QByteArray) used to return the size of the character data including the '\0'-terminator, whereas the new QByteArray::size() is just a synonym for QByteArray::length(). This brings QByteArray in line with QString.
When porting to Qt 4, occurrences of QCString should be replaced with QByteArray or QString. The following table summarizes the API differences between the Q3CString class and the Qt 4 QByteArray and QString classes:
Q3CString function | Qt 4 equivalent |
---|---|
Q3CString::Q3CString(const char *, uint) | See remark below |
Q3CString::Q3CString(int) | QByteArray::QByteArray(int, char) |
Q3CString::leftJustify() | QString::leftJustified() |
Q3CString::length() | QByteArray::length() or QByteArray::size() (equivalent) |
Q3CString::lower() | QByteArray::toLower() |
Q3CString::rightJustify() | QString::rightJustified() |
Q3CString::setExpand() | See remark below |
Q3CString::simplifyWhiteSpace() | QByteArray::simplified() |
Q3CString::sprintf() | QString::sprintf() |
Q3CString::stripWhiteSpace() | QByteArray::trimmed() |
Q3CString::toDouble() | QString::toDouble() |
Q3CString::toFloat() | QString::toFloat() |
Q3CString::toInt() | QString::toInt() |
Q3CString::toLong() | QString::toLong() |
Q3CString::toShort() | QString::toShort() |
Q3CString::toUInt() | QString::toUInt() |
Q3CString::toULong() | QString::toULong() |
Q3CString::toUShort() | QString::toUShort() |
Q3CString::upper() | QByteArray::toUpper() |
Remarks:
For example, if you have code like
QCString str1("Hello", 4); // "Hel" QCString str2("Hello world!", n);
you can rewrite it as
QByteArray str1("Hello", 3); QByteArray str2("Hello world!"); str2.truncate(n - 1);
For example, if you have code like
QCString str("Hello world"); str.setExpand(16, '\n'); // "Hello world \n"
you can rewrite it as
QByteArray str("Hello world"); while (str.size() < 16) str += ' '; str += '\n';
Since the old QCString class inherited from QByteArray, everything that is said in the QByteArray section applies for QCString as well.
In Qt 3, developers could create a custom event by constructing a new QCustomEvent, and send relevant data to other components in the application by passing a void pointer, either on construction or using the setData() function. Objects could receive custom events by reimplementing the customEvent() function, and access the stored data using the event's data() function.
In Qt 4, custom events are created by subclassing QEvent. Event-specific data can be stored in a way that is appropriate for your application. Custom events are still delivered to each object's customEvent() handler function, but as QEvent objects rather than as deprecated QCustomEvent objects.
The QDataBrowser class has been renamed Q3DataBrowser and moved to the Qt3Support library. In Qt 4.2, you should use the QDataWidgetMapper class to create data-aware forms.
See QtSql Module for an overview of the new SQL classes.
The QDataPump class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0.
If you use this mechanism in your application, please submit a report to the Task Tracker on the Trolltech website and we will try to find a satisfactory substitute.
The QDataSink class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0.
If you use this mechanism in your application, please submit a report to the Task Tracker on the Trolltech website and we will try to find a satisfactory substitute.
The QDataSource class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0. If you use this mechanism in your application, please submit a report to the Task Tracker on the Trolltech website and we will try to find a satisfactory substitute.
The QDataTable class has been renamed Q3DataTable and moved to the Qt3Support library. In Qt 4.2, you should use the QDataWidgetMapper class to create data-aware forms.
See QtSql Module for an overview of the new SQL classes.
The QDataView class has been renamed Q3DataView and moved to the Qt3Support library. In Qt 4.2, you should use the QDataWidgetMapper class to create data-aware forms.
See QtSql Module for an overview of the new SQL classes.
The QDateEdit class in Qt 4 is a convenience class based on QDateTimeEdit. The old class has been renamed Q3DateEdit and moved to the Qt3Support library.
See Virtual Functions for a list of QDateEdit virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QDateTimeEditBase class has been renamed Q3DateTimeEditBase and moved to Qt3Support. Use QDateTimeEdit or QAbstractSpinBox instead.
The old QDateTimeEdit class has been renamed Q3DateTimeEditBase and moved to Qt3Support. The new QDateTimeEdit in Qt 4 has been rewritten from scratch to provide a more flexible and powerful API.
See Virtual Functions for a list of QDateTimeEdit virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QDeepCopy<T> class in Qt 3 provided a means of ensuring that implicitly shared and explicitly shared classes referenced unique data. This was necessary because the reference counting in Qt's container classes was done in a thread-unsafe manner.
With Qt 4, QDeepCopy<T> has been renamed Q3DeepCopy<T> and moved to the Qt3Support library. Removing it from existing code is straightforward.
For example, if you have code like
QString str1 = "I am a string"; QDeepCopy<QString> str2 = str1; QString str3 = QDeepCopy<QString>(str2);
you can rewrite it as
QString str1 = "I am a string"; QString str2 = str1; QString str3 = str2;
See Virtual Functions for a list of QDial virtual member functions in Qt 3 that are no longer virtual in Qt 4.
See Properties for a list of QDial properties in Qt 3 that have changed in Qt 4.
QDict<T> has been renamed Q3Dict<T> and moved to Qt3Support. It has been replaced by the more modern QHash<Key, T> and QMultiHash<Key, T> classes.
When porting old code that uses QDict<T> to Qt 4, there are four classes that you can use:
Qt 4 class | When to use it |
---|---|
QMultiHash<QString, T *> | Since Q3Dict<T> is pointer-based and allows duplicate keys, this is usually the most straightforward conversion. |
QMultiHash<QString, T> | If type T is an assignable data type, you can use T as the value type rather than T *. This often leads to nicer code. |
QHash<QString, T *> | If you don't use duplicate keys, you can use QHash instead of QMultiHash. QMultiHash inherits from QHash. |
QHash<QString, T> |
The APIs of Q3Dict<T> and QMultiHash<QString, T *> are quite similar. The main issue is that Q3Dict supports auto-delete whereas QMultiHash doesn't.
The following table summarizes the API differences between the two classes:
Q3Dict function | QMultiHash equivalent |
---|---|
Q3Dict::Q3Dict(int size, bool caseSensitive) | See remarks below |
Q3Dict::autoDelete() | N/A |
Q3Dict::count() | QMultiHash::count() or QMultiHash::size() (equivalent) |
Q3Dict::find(const QString &) | QMultiHash::value(const QString &) |
Q3Dict::remove(const QString &) | QMultiHash::take(const QString &) |
Q3Dict::resize(uint) | QMultiHash::reserve(int) |
Q3Dict::setAutoDelete() | See discussion below |
Q3Dict::size() | QMultiHash::capacity() |
Q3Dict::statistics() | N/A |
Q3Dict::operator[](const QString &) | See remark below |
Remarks:
If you use Q3Dict's auto-delete feature (by calling Q3Dict::setAutoDelete(true)), you need to do some more work. You have two options: Either you call delete yourself whenever you remove an item from the container, or you use QMultiHash<QString, T> instead of QMultiHash<QString, T *> (i.e. store values directly instead of pointers to values). Here, we'll see when to call delete.
The following table summarizes the idioms that you need to watch out for if you want to call delete yourself.
Q3Dict idiom | QMultiHash idiom |
---|---|
dict.replace(key, value); | delete hash.take(key); hash.insert(key, value); |
dict.remove(key, value); | delete hash.take(key); |
dict.clear(); (also called from Q3Dict's destructor) | while (!hash.isEmpty()) { T *value = *hash.begin(); hash.erase(hash.begin()); delete value; } In 99% of cases, the following idiom also works: qDeleteAll(hash); hash.clear(); However, it may lead to crashes if hash is referenced from the value type's destructor, because hash contains dangling pointers until clear() is called. |
Be aware that Q3Dict's destructor automatically calls clear(). If you have a Q3Dict data member in a custom class and use the auto-delete feature, you will need to call delete on all the items in the container from your class destructor to avoid a memory leak.
Finally, QDictIterator<T> (renamed Q3DictIterator<T>) must also be ported. There are no fewer than four iterator classes that can be used as a replacement: QHash::const_iterator, QHash::iterator, QHashIterator, and QMutableHashIterator. The most straightforward class to use when porting is QHashIterator<QString, T *>. The following table summarizes the API differences:
Q3DictIterator functions | Qt 4 equivalent |
---|---|
Q3DictIterator::count() | QHash::count() or QHash::size() |
Q3DictIterator::current() | QHashIterator::value() |
Q3DictIterator::currentKey() | QHashIterator::key() |
Q3DictIterator::isEmpty() | QHash::isEmpty() |
Q3DictIterator::toFirst() | QHashIterator::toFront() |
Q3DictIterator::operator()() | QHashIterator::value() |
Q3DictIterator::operator*() | QHashIterator::value() |
Q3DictIterator::operator++() | See remark below |
Be aware that QHashIterator has a different way of iterating than Q3DictIterator. A typical loop with Q3DictIterator looks like this:
Q3DictIterator<QWidget> i(dict); while (i.current() != 0) { do_something(i.currentKey(), i.current()); ++i; }
Here's the equivalent QHashIterator loop:
QHashIterator<QString, QWidget *> i(hash);
while (i.hasNext()) {
i.next(); // must come first
do_something(i.key(), i.value());
}
See Java-style iterators for details.
The following functions used to have a boolean acceptAbsPath parameter that defaulted to true:
In Qt 3, if acceptAbsPath is true, a file name starting with '/' is be returned without change; if acceptAbsPath is false, an absolute path is prepended to the file name. For example:
Current directory | File name | acceptAbsPath | File path |
---|---|---|---|
/home/tsmith | index.html | true | /home/tsmith/index.html |
false | /home/tsmith/index.html | ||
/home/tsmith | /index.html | true | /index.html |
false | /home/tsmith/index.html |
In Qt 4, this parameter is no longer available. If you use it in your code, you can check that QDir::isRelativePath() returns false instead.
For example, if you have code like
QDir dir("/home/tsmith"); QString path = dir.filePath(fileName, false);
you can rewrite it as
QDir dir("/home/tsmith"); QString path; if (dir.isRelativePath(fileName)) path = dir.filePath(fileName); else path = fileName;
QDir::encodedEntryList() has been removed.
fileInfoList(), entryInfoList(), and drives() now return a QList<QFileInfo> and not a QPtrList<QFileInfo> *. Code using these methods will not work with the Qt3Support library and must be adapted instead.
See Virtual Functions for a list of QDir virtual member functions in Qt 3 that are no longer virtual in Qt 4.
QDir::match() now always matches case insensitively.
QDir::homeDirPath() has been removed. Use QDir::home() instead, and extract the path separately.
Qt 3 used its own implementation of the DNS protocol and provided a low-level QDns class. Qt 4's QHostInfo class uses the system's gethostbyname() function from a thread instead.
The old QDns class has been renamed Q3Dns and moved to the Qt3Support library. The new QHostInfo class has a radically different API: It consists mainly of two static functions, one of which is blocking (QHostInfo::fromName()), the other non-blocking (QHostInfo::lookupHost()). See the QHostInfo class documentation for details.
The QDockArea class has been renamed Q3DockArea and moved to the Qt3Support library. In Qt 4, QMainWindow handles the dock and toolbar areas itself. See the QMainWindow documentation for details.
The old QDockWindow class has been renamed Q3DockWindow and moved to the Qt3Support library. In Qt 4, there is a new QDockWidget class with a different API. See the class documentation for details.
See Virtual Functions for a list of QDockWidget virtual member functions in Qt 3 that are no longer virtual in Qt 4.
Note: Q3DockWindow's horizontallyStretchable property can be achieved in QDockWidget with size policies.
The QDragObject class has been renamed Q3DragObject and moved to the Qt3Support library. In Qt 4, it has been replaced by the QMimeData class. See the class documentation for details.
Note that the Q3DragObject::DragCopyOrMove drag and drop mode is interpreted differently to Qt 3's QDragObject::DragCopyOrMove mode. In Qt 3, a move operation was performed by default, and the user had to hold down the Ctrl key to perform a copy operation. In Qt 4, a copy operation is performed by default; the user has to hold down the Shift key to perform a move operation.
See Porting to Qt 4 (Drag and Drop) for a comparison between the drag and drop APIs in Qt 3 and Qt 4.
The QDropSite class has been renamed Q3DropSite and moved to the Qt3Support library.
The QDropSite class has been obsolete ever since Qt 2.0. The only thing it does is call QWidget::setAcceptDrops(true).
For example, if you have code like
class MyWidget : public QWidget, public QDropSite { public: MyWidget(const QWidget *parent) : QWidget(parent), QDropSite(this) { } ... }
you can rewrite it as
class MyWidget : public QWidget { public: MyWidget(const QWidget *parent) : QWidget(parent) { setAcceptDrops(true); } ... }
See Porting to Qt 4 (Drag and Drop) for a comparison between the drag and drop APIs in Qt 3 and Qt 4.
The QEditorFactory class has been renamed Q3EditorFactory and moved to the Qt3Support library.
See QtSql Module for an overview of the new SQL classes.
In Qt 3, QEventLoop combined the Qt event loop and the event dispatching. In Qt 4, these tasks are now assigned to two distinct classes: QEventLoop and QAbstractEventDispatcher.
If you subclassed QEventLoop to integrate with another library's event loop, you must subclass QAbstractEventDispatcher instead. See the class documentation for details.
The QFileDialog class in Qt 4 has been totally rewritten. It provides most of the functionality of the old QFileDialog class, but with a different API. Some functionality, such as the ability to preview files, is expected to be added in a later Qt 4 release.
The old QFileDialog, QFileIconProvider, and QFilePreview classes has been renamed Q3FileDialog, Q3FileIconProvider, and Q3FilePreview and have been moved to Qt3Support. You can use them if you need some functionality not provided yet by the new QFileDialog class.
The following table lists which functions have been renamed or removed in Qt 4.
Old function | Qt 4 equivalent |
---|---|
Q3FileDialog::addFilter(const QString &) | See remark below |
Q3FileDialog::addLeftWidget(QWidget *) | N/A |
Q3FileDialog::addRightWidget(QWidget *) | N/A |
Q3FileDialog::addToolButton(QAbstractButton *, bool separator) | N/A |
Q3FileDialog::addWidgets(QLabel *, QWidget *, QPushButton *) | N/A |
Q3FileDialog::dir() | QFileDialog::directory() |
Q3FileDialog::dirPath() | QFileDialog::directory().path() |
Q3FileDialog::iconProvider() | N/A |
Q3FileDialog::isContentsPreviewEnabled() | N/A |
Q3FileDialog::isInfoPreviewEnabled() | N/A |
Q3FileDialog::previewMode() | N/A |
Q3FileDialog::rereadDir() | N/A |
Q3FileDialog::resortDir() | N/A |
Q3FileDialog::selectAll(bool) | N/A |
Q3FileDialog::setContentsPreview(QWidget *, Q3FilePreview *) | N/A |
Q3FileDialog::setContentsPreviewEnabled(bool) | N/A |
Q3FileDialog::setDir(const QString &) | QFileDialog::setDirectory(const QString &) |
Q3FileDialog::setFilters(const char **) | Q3FileDialog::setFilters(const QStringList &) |
Q3FileDialog::setIconProvider(Q3FileIconProvider *) | N/A |
Q3FileDialog::setInfoPreview(QWidget *, Q3FilePreview *) | N/A |
Q3FileDialog::setInfoPreviewEnabled(bool) | N/A |
Q3FileDialog::setPreviewMode(PreviewMode) | N/A |
Q3FileDialog::setSelectedFilter(const QString &) | QFileDialog::selectFilter(const QString &) |
Q3FileDialog::setSelectedFilter(int) | See remark below |
Q3FileDialog::setSelection(const QString &) | QFileDialog::selectFile(const QString &) |
Q3FileDialog::setShowHiddenFiles(bool) | showHidden() |
Q3FileDialog::setUrl(const QUrlOperator &) | N/A |
Q3FileDialog::showHiddenFiles() | N/A |
Q3FileDialog::url() | QUrl::fromLocalFile(QFileDialog::directory()) |
Old signals | Qt 4 equivalent |
Q3FileDialog::fileHighlighted(const QString &) | N/A |
Q3FileDialog::fileSelected(const QString &) | QFileDialog::filesSelected(const QStringList &) |
Q3FileDialog::dirEntered(const QString &) | N/A |
Q3FileDialog::filterSelected(const QString &) | N/A |
Remarks:
For example, if you have code like
fileDialog->addFilter(tr("JPEG files (*.jpg *.jpeg)"));
you can rewrite it as
QStringList filters = fileDialog->filters(); filters << tr("JPEG files (*.jpg *.jpeg)"); fileDialog->setFilters(filters);
For example, if you have code like
fileDialog->setSelectedFilter(3);
you can rewrite it as
fileDialog->selectFilter(fileDialog->filters().at(3));
See Virtual Functions for a list of QFileDialog virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QFocusData class is not available in Qt 4. Some of its functionality is available via the QWidget::nextInFocusChain() and QWidget::focusNextPrevChild() functions.
The setReason() function is no longer present in Qt 4. It is necessary to define the reason when constructing a focus event.
QFont::Script has been moved to QFontDatabase::WritingSystem.
The QFrame class has been made more lightweight in Qt 4, by reducing the number of properties and virtual functions. The reduction in the number of virtual functions is significant because QFrame is the base class of many Qt classes.
Here's an overview of the changes:
To help with porting, the Qt3Support library contains a Q3Frame class that inherits QFrame and provides a similar API to the old QFrame class. If you derived from QFrame in your application, you might want to use Q3Frame as a base class as a first step in the porting process, and later move on to the new QFrame class.
See Virtual Functions for a list of QFrame virtual member functions in Qt 3 that are no longer virtual in Qt 4.
QFtp no longer inherits from QNetworkProtocol. See the section on QNetworkProtocol for details.
The old QFtp class has been renamed Q3Ftp and moved to the Qt3Support library.
The QGLayoutIterator class no longer exists in Qt 4. This makes only a difference if you implemented custom layout managers (i.e., QLayout subclasses).
The new approach is much simpler: It consists in reimplementing QLayout::itemAt() and QLayout::takeAt(). These functions operate on indexes, eliminating the need for a layout iterator class.
The QGrid class is now only available as Q3Grid in Qt 4. You can achieve the same result as QGrid by creating a QWidget with a grid layout:
For example, if you have code like
QGrid *grid = new QGrid(2, Qt::Horizontal); QPushButton *child1 = new QPushButton(grid); QPushButton *child2 = new QPushButton(grid); QPushButton *child3 = new QPushButton(grid); QPushButton *child4 = new QPushButton(grid);
you can rewrite it as
QWidget *grid = new QWidget; QPushButton *child1 = new QPushButton(grid); QPushButton *child2 = new QPushButton(grid); QPushButton *child3 = new QPushButton(grid); QPushButton *child4 = new QPushButton(grid); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(child1, 0, 0); layout->addWidget(child2, 0, 1); layout->addWidget(child3, 1, 0); layout->addWidget(child4, 1, 1); grid->setLayout(layout);
See Virtual Functions for a list of QGridLayout virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QGridView class has been renamed Q3GridView and moved to the Qt3Support library. In Qt 4, we recommend that you use QTableView or QAbstractItemView for presenting tabular data.
See Model/View Programming for an overview of the new item view classes.
The QGroupBox class has been redesigned in Qt 4. Many of the features of the old QGroupBox class can be obtained by using the Q3GroupBox class from the Qt3Support library.
The new QGroupBox is more lightweight. It doesn't attempt to duplicate functionality already provided by QGridLayout, and it does not inherit from QFrame. As a result, the following members have been removed:
Naturally, the columns and orientation properties have also been removed.
If you rely on some of the missing functionality in your application, you can use Q3GroupBox instead of QGroupBox as a help to porting.
See Virtual Functions for a list of QGroupBox virtual member functions in Qt 3 that are no longer virtual in Qt 4.
The QHBox class is now only available as Q3HBox in Qt 4. You can achieve the same result as QHBox by creating a QWidget with an horizontal layout:
For example, if you have code like
QHBox *hbox = new QHBox; QPushButton *child1 = new QPushButton(hbox); QPushButton *child2 = new QPushButton(hbox);
you can rewrite it as
QWidget *hbox = new QWidget; QPushButton *child1 = new QPushButton; QPushButton *child2 = new QPushButton; QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(child1); layout->addWidget(child2); hbox->setLayout(layout);
Note that child widgets are not automatically placed into the widget's layout; you will need to manually add each widget to the QHBoxLayout.
The QHeader class has been renamed Q3Header and moved to the Qt3Support library. In Qt 4, it is replaced by the QHeaderView class.
See Model/View Programming for an overview of the new item view classes.
The QHGroupBox class has been renamed Q3HGroupBox and moved to the Qt3Support library. Qt 4 does not provide a specific replacement class for QHGroupBox since QGroupBox is designed to be a generic container widget. As a result, you need to supply your own layout for any child widgets.
See #QGroupBox for more information about porting code that uses group boxes.
QHttp no longer inherits from QNetworkProtocol. See the See the section on QNetworkProtocol for details.
The old QHttp, QHttpHeader, QHttpRequestHeader, and QHttpResponseHeader classes have been renamed Q3Http, Q3HttpHeader, Q3HttpRequestHeader, and Q3HttpResponseHeader and have been moved to the Qt3Support library.
The QIconFactory class is no longer part of Qt. It has been replaced by the QIconEngine class.
The QIconSet class is no longer part of Qt. It has been replaced by the QIcon class.
The QIconView, QIconViewItem, QIconDrag, and QIconDragItem classes has been renamed Q3IconView, Q3IconViewItem, Q3IconDrag, and Q3IconDragItem and moved to the Qt3Support library. New Qt applications should use QListWidget or its base class QListView instead, and call QListView::setViewMode(QListView::IconMode) to obtain an "icon view" look.
See Model/View Programming for an overview of the new item view classes.
The QImageDrag class has been renamed Q3ImageDrag and moved to the Qt3Support library. In Qt 4, use QMimeData instead and call QMimeData::setImage() to set the image.
See Porting to Qt 4 (Drag and Drop) for a comparison between the drag and drop APIs in Qt 3 and Qt 4.
The QImageIO class has been split into two classes: QImageReader and QImageWriter. The table below shows the correspondance between the two APIs:
Qt 3 function | Qt 4 equivalents |
---|---|
QImageIO::description() | QImageWriter::description() |
QImageIO::fileName() | QImageReader::fileName() and QImageWriter::fileName() |
QImageIO::format() | QImageReader::format() and QImageWriter::format() |
QImageIO::gamma() | QImageWriter::gamma() |
QImageIO::image() | Return value of QImageReader::read() |
QImageIO::inputFormats() | QImageReader::supportedImageFormats() |
QImageIO::ioDevice() | QImageReader::device() and QImageWriter::device() |
QImageIO::outputFormats() | QImageWriter::supportedImageFormats() |
QImageIO::parameters() | N/A |
QImageIO::quality() | QImageWriter::quality() |
QImageIO::read() | QImageReader::read() |
QImageIO::setDescription() | QImageWriter::setDescription() |
QImageIO::setFileName() | QImageReader::setFileName() and QImageWriter::setFileName() |
QImageIO::setFormat() | QImageReader::setFormat() and QImageWriter::setFormat() |
QImageIO::setGamma() | QImageWriter::setGamma() |
QImageIO::setIODevice() | QImageReader::setDevice() and QImageWriter::setDevice() |
QImageIO::setImage() | Argument to QImageWriter::write() |
QImageIO::setParameters() | N/A |
QImageIO::setQuality() | QImageWriter::setQuality() |
QImageIO::setStatus() | N/A |
QImageIO::status() | QImageReader::error() and QImageWriter::error() |
QImageIO::write() | QImageWriter::write() |
QIntCache<T> has been moved to Qt3Support. It has been replaced by QCache<int, T>.
For details, read the section on QCache<T>, mentally substituting int for QString.
QIntDict<T> and QIntDictIterator<T> have been moved to Qt3Support. They have been replaced by the more modern QHash<Key, T> and QMultiHash<Key, T> classes and their associated iterator classes.
When porting old code that uses QIntDict<T> to Qt 4, there are four classes that you can use:
For details, read the section on QDict<T>, mentally substituting int for QString.
The QIODevice class's API has been simplified to make it easier to subclass and to make it work more smoothly with asynchronous devices such as QTcpSocket and QProcess.
The following virtual functions have changed name or signature:
Qt 3 function | Comment |
---|---|
QIODevice::at() const | Renamed QIODevice::pos(). |
QIODevice::at(Offset) | Renamed QIODevice::seek(). |
QIODevice::open(int) | The parameter is now of type QIODevice::OpenMode. |
QIODevice::readBlock(char *, Q_ULONG) | QIODevice::read(char *, qint64) |
QIODevice::writeBlock(const char *, Q_ULONG) | QIODevice::write(const char *, qint64) |
Note: QIODevice::open(QIODevice::OpenMode) is no longer pure virtual.
The following functions are no longer virtual or don't exist anymore:
QIODevice::getch() | Renamed QIODevice::getChar() and implemented in terms of QIODevice::readData(). |
QIODevice::putch(int) | Renamed QIODevice::putChar() and implemented in terms of QIODevice::writeData(). |
QIODevice::readAll() | Implemented in terms of QIODevice::readData(). |
QIODevice::readLine(char *, Q_ULONG) | Implemented in terms of QIODevice::readData() |
QIODevice::ungetch(int) | Renamed QIODevice::ungetChar() and simulated using an internal unget buffer. |
The IO_xxx flags have been revised, and the protected setFlags() function removed. Most of the flags have been eliminated because errors are best handled by implementing certain functions in QIODevice subclasses rather than through the base classes. The file access flags, such as IO_ReadOnly and IO_WriteOnly, have been moved to the QIODevice class to avoid polluting the global namespace. The table below shows the correspondence between the Qt 3 IO_xxx flags and the Qt 4 API:
Qt 3 constant | Qt 4 equivalent |
---|---|
IO_Direct | Use !QIODevice::isSequential() instead (notice the not). |
IO_Sequential | Use QIODevice::isSequential() instead. |
IO_Combined | N/A |
IO_TypeMask | N/A |
IO_Raw | QIODevice::Unbuffered |
IO_Async | N/A |
IO_ReadOnly | QIODevice::ReadOnly |
IO_WriteOnly | QIODevice::WriteOnly |
IO_ReadWrite | QIODevice::ReadWrite |
IO_Append | QIODevice::Append |
IO_Truncate | QIODevice::Truncate |
IO_Translate | QIODevice::Text |
IO_ModeMask | N/A |
IO_Open | Use QIODevice::isOpen() instead. |
IO_StateMask | N/A |
IO_Ok | N/A |
IO_ReadError | N/A |
IO_WriteError | N/A |
IO_FatalError | N/A |
IO_ResourceError | N/A |
IO_OpenError | N/A |
IO_ConnectError | N/A |
IO_AbortError | N/A |
IO_TimeOutError | N/A |
IO_UnspecifiedError | N/A |
The QIODeviceSource class was used internally in Qt 2.x in conjunction with QImageConsumer. It was obsoleted in Qt 3.0. If you use this mechanism in your application, please submit a report to the Task Tracker on the Trolltech website and we will try to find a satisfactory substitute.
QLabel doesn't enable word-wrap automatically anymore when rich text is used. You can enable it by calling QLabel::setWordWrap() or by setting the wordWrap property. The reason for this change is that the old behavior was confusing to many users.
Also, QLabel no longer offers an autoResize property. Instead, you can call QWidget::setFixedSize() on the label, with QLabel::sizeHint() as the argument, whenever you change the contents of the QLabel.
See also Virtual Functions for a list of QLabel virtual member functions in Qt 3 that are no longer virtual in Qt 4.
In Qt 4, margins are always handled by layouts; there is no QLayout::setSupportsMargin() function anymore.
The deleteAllItems() function is now only available if QT3_SUPPORT is defined. If you maintain a QList of layout items, you can use qDeleteAll() to remove all the items in one go.
In Qt 3, it was possible to change the resizing behavior for layouts in top-level widgets by adjusting the layout's resizeMode property. In Qt 4, this property has been replaced by the QLayout::sizeConstraint property which provides more control over how the layout behaves when resized.
See also the section on QLayoutIterator and the section on QGLayoutIterator.
The QLayoutIterator class is obsoleted in Qt 4. It is available only if QT3_SUPPORT is defined. It can be replaced by the QLayout::itemAt() and QLayout::takeAt() functions, which operate on indexes.
For example, if you have code like
QLayoutIterator it = layout()->iterator(); QLayoutItem *child; while ((child = it.current()) != 0) { if (child->widget() == myWidget) { it.takeCurrent(); return; ++it; }
you can rewrite it as
int i = 0; QLayoutItem *child; while ((child = layout()->itemAt(i)) != 0) { if (child->widget() == myWidget) { layout()->takeAt(i); return; } ++i; }
See Properties for a list of QLineEdit properties in Qt 3 that have changed in Qt 4.
Note that QLineEdit in Qt 4 is no longer a subclass of QFrame. If you need to visually style a line edit with a frame, we recommend either using a QFrame as a container for a QLineEdit or customizing the line edit with a style sheet.
The QListBox, QListBoxItem, QListBoxText, and QListBoxPixmap classes have been renamed Q3ListBox, Q3ListBoxItem, Q3ListBoxText, and Q3ListBoxPixmap and have been moved to the Qt3Support library. New Qt applications should use QListWidget or its base class QListView instead.
See Model/View Programming for an overview of the new item view classes.
The QListView, QListViewItem, QCheckListItem, and QListViewItemIterator classes have been renamed Q3ListView, Q3ListViewItem, Q3CheckListItem, and Q3ListViewItemIterator, and have been moved to the Qt3Support library. New Qt applications should use one of the following four classes instead: QTreeView or QTreeWidget for tree-like structures; QListWidget or the new QListView class for one-dimensional lists.
See Model/View Programming for an overview of the new item view classes.
The QLocalFs class is no longer part of the public Qt API. It has been renamed Q3LocalFs and moved to Qt3Support. Use QDir, QFileInfo, or QFile instead.
The QMainWindow class has been redesigned in Qt 4 to provide a more modern look and feel and more flexibility. The API has changed to reflect that. The old QMainWindow class has been renamed Q3MainWindow and moved to Qt3Support. See the QMainWindow class documentation for details.
QMemArray<T> has been moved to Qt3Support. It has been replaced by the QVector<T> class.
The following table summarizes the API differences between the two classes.
QMemArray::assign(const QMemArray<T> &) | QVector::operator=() |
QMemArray::assign(const T *, uint) | See remark below |
QMemArray::duplicate(const QMemArray &) | QVector::operator=() |
QMemArray::duplicate(const T *, uint) | See remark below |
QMemArray::setRawData(const T *, uint) | N/A |
QMemArray::resetRawData(const T *, uint) | N/A |
QMemArray::find(const T &, uint) | QVector::indexOf(const T &, int) |
QMemArray::contains(const T &) | QVector::count(const T &) |
QMemArray::sort() | qSort() |
QMemArray::bsearch(const T &d) | qBinaryFind() |
QMemArray::at(uint) | QVector::operator[]() |
QMemArray::operator const T *() | QVector::constData() |
Remarks:
For example, if you have code like
QMemArray<QSize> array; ... array.assign(data, size);
you can rewrite it as
QVector<QSize> vector; ... vector.resize(size); qCopy(data, data + size, vector.begin());
In Qt 3, QMenuBar inherited from QFrame and QMenuData; in Qt 4, it is a direct subclass of QWidget. Applications that provided customized menu bars will need to take advantage of the styling features described in the Qt Style Sheets document.
It is not possible to add widgets to menu bars in Qt 4.
In Qt 4, the QMenu class provides a menu widget that can be used in all the places where menus are used in an application. Unlike QMenuData, QMenu is designed around the concept of actions, provided by the QAction class, instead of the identifiers used in Qt 3.
In Qt 3, it was possible to insert widgets directly into menus by using a specific QMenuData::insertItem() overload. In Qt 4.2 and later, the QWidgetAction class can be used to wrap widgets for use in Qt 4's action-based APIs.
The QMessageBox::iconPixmap() function used to return a "const QPixmap *". In Qt 4, it returns a QPixmap.
The QMimeSourceFactory has been renamed Q3MimeSourceFactory and moved to the Qt3Support library. New Qt applications should use Qt 4's Resource System instead.
The QMovie API has been revised in Qt 4 to make it more consistent with the other Qt classes (notably QImageReader). The table below summarizes the changes.
Qt 3 function | Qt 4 equivalent |
---|---|
QMovie::connectResize() | Connect to QMovie::resized() |
QMovie::connectStatus() | Connect to QMovie::stateChanged() |
QMovie::connectUpdate() | Connect to QMovie::updated() |
QMovie::disconnectResize() | Disconnect from QMovie::resized() |
QMovie::disconnectStatus() | Disconnect from QMovie::stateChanged() |
QMovie::disconnectUpdate() | Disconnect from QMovie::updated() |
QMovie::finished() | Use QMovie::state() instead |
QMovie::frameImage() | Use QMovie::currentImage() instead |
QMovie::frameNumber() | Use QMovie::currentFrameNumber() instead |
QMovie::framePixmap() | Use QMovie::currentPixmap() instead |
QMovie::getValidRect() | Use frameRect() instead |
QMovie::isNull() | Use QMovie::isValid() instead |
QMovie::pause() | Use QMovie::setPaused(true) instead |
QMovie::paused() | Use QMovie::state() instead |
QMovie::pushData() | N/A |
QMovie::pushSpace() | N/A |
QMovie::restart() | Use QMovie::jumpToFrame(0) instead |
QMovie::running() | Use QMovie::state() instead |
QMovie::step() | Use QMovie::jumpToFrame() and QMovie::setPaused() instead |
QMovie::step() | Use QMovie::jumpToNextFrame() instead |
QMovie::steps() | Use QMovie::currentFrameNumber() and QMovie::frameCount() instead |
QMovie::unpause() | Use QMovie::setPaused(false) instead |
The QMultiLineEdit class in Qt 3 was a convenience QTextEdit subclass that provided an interface compatible with Qt 2's QMultiLineEdit class. In Qt 4, it is called Q3MultiLineEdit, it inherits Q3TextEdit, and it is part of Qt3Support. Use QTextEdit in new code.
The QNetworkProtocol, QNetworkProtocolFactoryBase, QNetworkProtocolFactory<T>, and QNetworkOperation classes are no longer part of the public Qt API. They have been renamed Q3NetworkProtocol, Q3NetworkProtocolFactoryBase, Q3NetworkProtocolFactory<T>, and Q3NetworkOperation and have been moved to the Qt3Support library.
In Qt 4 applications, you can use classes like QFtp and QHttp directly to perform file-related actions on a remote host.
QObject::children() now returns a QObjectList instead of a pointer to a QObjectList. See also the comments on QObjectList below.
Use QObject::findChildren() (or qFindChildren() if you need MSVC 6 compatibility) instead of QObject::queryList(). For example:
QList<QWidget *> myWidgets = qFindChildren<QWidget *>(myParent);
QObject::killTimers() has been removed because it was unsafe to use in subclass. (A subclass normally doesn't know whether the base class uses timers or not.)
The QObject::name property has been renamed QObject::objectName.
QObject::objectTrees() has been removed. If you are primarly interested in widgets, use QApplication::allWidgets() or QApplication::topLevelWidgets().
The QObjectDictionary class is a synonym for QAsciiDict<QMetaObject>. See the section on QAsciiDict<T>.
In Qt 3, the QObjectList class was a typedef for QPtrList<QObject>. In Qt 4, it is a typedef for QList<QObject *>. See the section on QPtrList<T>.
To reimplement painter backends one previously needed to reimplement the virtual function QPaintDevice::cmd(). This function is taken out and should is replaced with the function QPaintDevice::paintEngine() and the abstract class QPaintEngine. QPaintEngine provides virtual functions for all drawing operations that can be performed on a painter backend.
bitBlt() and copyBlt() are now only compatibility functions. Use QPainter::drawPixmap() instead.
All functions that used to be provided by the QPaintDeviceMetrics class have now been moved to QPaintDevice.
For example, if you have code like
QPaintDeviceMetrics metrics(widget); int deviceDepth = metrics.depth();
you can rewrite it as
int deviceDepth = widget->depth();
For compatibility, the old QPaintDeviceMetrics class has been renamed Q3PaintDeviceMetrics and moved to Qt3Support.
The QPainter class has undergone some changes in Qt 4 because of the way rectangles are drawn. In Qt 4, the result of drawing a QRect with a pen width of 1 pixel is 1 pixel wider and 1 pixel taller than in Qt 3.
For compatibility, we provide a Q3Painter class in Qt3Support that provides the old semantics. See the Q3Painter documentation for details and for the reasons why we had to make this change.
The QPainter::CoordinateMode enum has been removed in Qt 4. All clipping operations are now defined using logical coordinates and are subject to transformation operations.
The QPainter::RasterOP enum has been replaced with QPainter::CompositionMode.
In Qt 3, a QPicture could be saved in the SVG file format. In Qt 4, the SVG support is separated into the QtSvg module, which provides classes for displaying the contents of SVG files. Qt 4 does not currently support saving of pictures in this format, but it can be achieved using the Q3Picture compatibility class.
The mask() function has been changed to return a reference to a QBitmap rather than a pointer. As a result, it is no longer possible simply to test for a null pointer when determining whether a pixmap has a mask. Instead, you need to explicitly test whether the mask bitmap is null or not.
For example, if you have code like
if (pixmap.mask()) widget->setMask(*pixmap.mask());
you can rewrite it as
if (!pixmap.mask().isNull()) widget->setMask(pixmap.mask());
The QPixmap::setOptimization() and QPixmap::setDefaultOptimization() mechanism is no longer available in Qt 4.
The QPointArray class has been renamed QPolygon in Qt 4 and has undergone significant changes. In Qt 3, QPointArray inherited from QMemArray<QPoint>. In Qt 4, QPolygon inherits from QVector<QPoint>. Everything mentioned in the section on QMemArray<T> apply for QPointArray as well.
The Qt3Support library contains a Q3PointArray class that inherits from QPolygon and provides a few functions that existed in QPointArray but no longer exist in QPolygon. These functions include Q3PointArray::makeArc(), Q3PointArray::makeEllipse(), and Q3PointArray::cubicBezier(). In Qt 4, we recommend that you use QPainterPath for representing arcs, ellipses, and Bezier curves, rather than QPolygon.
The QPolygon::setPoints() and QPolygon::putPoints() functions return void in Qt 4. The corresponding Qt 3 functions returned a bool indicating whether the array was successfully resized or not. This can now be checked by checking QPolygon::size() after the call.
For most purposes, QPopupMenu has been replaced by QMenu in Qt 4. For compatibility with older applications, Q3PopupMenu provides the old API and features that are specific to popup menus. Note that, when using Q3PopupMenu, the menu's actions must be Q3Actions.
In Qt 3, it was common practice to add entries to popup menus using the insertItem() function, maintaining identifiers for future use; for example, to dynamically change menu items. In Qt 4, menu entries are completely represented by actions for consistency with other user interface components, such as toolbar buttons. Create new menus with the QMenu class, and use the overloaded QMenu::addAction() functions to insert new entries. If you need to manage a set of actions created for a particular menu, we suggest that you construct a QActionGroup and add them to that.
The Main Window examples provided show how to use Qt's action system to construct menus, toolbars, and other common user interface elements.
The QPrinter class now expects printing to be set up from a QPrintDialog.
The QProcess class has undergone major improvements in Qt 4. It now inherits QIODevice, which makes it possible to combine QProcess with a QTextStream or a QDataStream.
The old QProcess class has been renamed Q3Process and moved to the Qt3Support library.
The QProgressBar API has been significantly improved in Qt 4. The old QProgressBar API is available as Q3ProgressBar in the Qt3Support library.
The QProgressDialog API has been significantly improved in Qt 4. The old QProgressDialog API is available as Q3ProgressDialog in the Qt3Support library.
See Properties for a list of QProgressDialog properties in Qt 3 that have changed in Qt 4.
The QPtrCollection<T> abstract base class has been renamed Q3PtrCollection<T> moved to the Qt3Support library. There is no direct equivalent in Qt 4.
See Generic Containers for a list of Qt 4 containers.
QPtrDict<T> and QPtrDictIterator<T> have been renamed Q3PtrDict<T> and Q3PtrDictIterator<T> and have been moved to the Qt3Support library. They have been replaced by the more modern QHash<Key, T> and QMultiHash<Key, T> classes and their associated iterator classes.
When porting old code that uses Q3PtrDict<T> to Qt 4, there are four classes that you can use:
(You can naturally use other types than void * for the key type, e.g. QWidget *.)
To port Q3PtrDict<T> to Qt 4, read the section on QDict<T>, mentally substituting void * for QString.
QPtrList<T>, QPtrListIterator<T>, and QPtrListStdIterator<T> have been moved to the Qt3Support library. They have been replaced by the more modern QList and QLinkedList classes and their associated iterator classes.
When porting to Qt 4, you have the choice of using QList<T> or QLinkedList<T> as alternatives to QValueList<T>. QList<T> has an index-based API and provides very fast random access (QList::operator[]), whereas QLinkedList<T> has an iterator-based API.
The following table summarizes the API differences between QPtrList<T> and QList<T *>:
QPtrList function | QList equivalent |
---|---|
QPtrList::contains(const T *) | QList::count(T *) |
QPtrList::containsRef(const T *) | QList::count(T *) |
QPtrList::find(const T *) | See remark below |
QPtrList::findRef(const T *) | See remark below |
QPtrList::getFirst() | QList::first() |
QPtrList::getLast() | QList::last() |
QPtrList::inSort(const T *) | N/A |
QPtrList::remove(const T *) | QList::removeAll(T *) |
QPtrList::remove(uint) | QList::removeAt(int) |
QPtrList::removeNode(QLNode *) | N/A |
QPtrList::removeRef(const T *) | QList::removeAll(T *) |
QPtrList::sort() | See remark below |
QPtrList::takeNode(QLNode *) | N/A |
QPtrList::toVector(QGVector *) | See remark below |
Remarks:
For example, if you have code like
QPtrList<QWidget> list; ... QPtrVector<QWidget> vector; list.toVector(&vector);
you can rewrite it as
QList<QWidget *> list; ... QVector<QWidget *> vector; vector.resize(list.size()); qCopy(list.begin(), list.end(), vector.begin());
If you use QPtrList's auto-delete feature (by calling QPtrList::setAutoDelete(true)), you need to do some more work. You have two options: Either you call delete yourself whenever you remove an item from the container, or you can use QList<T> instead of QList<T *> (i.e. store values directly instead of pointers to values). Here, we'll see when to call delete.
The following table summarizes the idioms that you need to watch out for if you want to call delete yourself.
QPtrList idiom | QList idiom |
---|---|
list.replace(index, value); | delete list[index]; list[index] = value; |
list.removeFirst(); | delete list.takeFirst(); |
list.removeLast(); | delete list.takeLast(); |
list.remove(index); | delete list.takeAt(index); |
list.remove(value); | int i = list.indexOf(value); if (i != -1) delete list.takeAt(i); |
list.remove(); (removes the current item) | QMutableListIterator<T *> i; ... delete i.value(); i.remove(); |
list.clear(); (also called from QPtrList's destructor) | while (!list.isEmpty()) delete list.takeFirst(); In 99% of cases, the following idiom also works: qDeleteAll(list); list.clear(); However, it may lead to crashes if list is referenced from the value type's destructor, because list contains dangling pointers until clear() is called. |
Be aware that QPtrList's destructor automatically calls clear(). If you have a QPtrList data member in a custom class and use the auto-delete feature, you will need to call delete on all the items in the container from your class destructor to avoid a memory leak.
QPtrList had the concept of a "current item", which could be used for traversing the list without using an iterator. When porting to Qt 4, you can use the Java-style QListIterator<T *> (or QMutableListIterator<T *>) class instead. The following table summarizes the API differences:
QPtrList function | QListIterator equivalent |
---|---|
QPtrList::at() | N/A |
QPtrList::current() | QMutableListIterator::value() |
QPtrList::currentNode() | N/A |
QPtrList::findNext(const T *) | QListIterator::findNext(const T *) |
QPtrList::findNextRef(const T *) | QListIterator::findNext(const T *) |
QPtrList::first() | QPtrList::toFront() |
QPtrList::last() | QPtrList::toBack() |
QPtrList::next() | QPtrList::next() |
QPtrList::prev() | QPtrList::previous() |
QPtrList::remove() | QMutableListIterator::remove() |
QPtrList::take() | QMutableListIterator::remove() |
Be aware that QListIterator has a different way of iterating than QPtrList. A typical loop with QPtrList looks like this:
QPtrList<QWidget> list; ... while (list.current() != 0) { do_something(list.current()); list.next(); }
Here's the equivalent QListIterator loop:
QList<QWidget *> list; ... QListIterator<QWidget *> i(list); while (i.hasNext()) do_something(i.next());
Finally, QPtrListIterator<T> must also be ported. There are no fewer than four iterator classes that can be used as a replacement: QList::const_iterator, QList::iterator, QListIterator, and QMutableListIterator. The most straightforward class to use when porting is QMutableListIterator<T *> (if you modify the list through the iterator) or QListIterator<T *> (if you don't). The following table summarizes the API differences:
QPtrListIterator function | Qt 4 equivalent |
---|---|
QPtrListIterator::atFirst() | !QListIterator::hasPrevious() (notice the !) |
QPtrListIterator::atLast() | !QListIterator::hasNext() (notice the !) |
QPtrListIterator::count() | QList::count() or QList::size() |
QPtrListIterator::current() | QMutableListIterator::value() |
QPtrListIterator::isEmpty() | QList::isEmpty() |
QPtrListIterator::toFirst() | QListIterator::toFront() |
QPtrListIterator::toLast() | QListIterator::toBack() |
QPtrListIterator::operator() | QMutableListIterator::value() |
QPtrListIterator::operator*() | QMutableListIterator::value() |
Again, be aware that QListIterator has a different way of iterating than QPtrList. A typical loop with QPtrList looks like this:
QPtrList<QWidget> list; ... QPtrListIterator<QWidget> i; while (i.current() != 0) { do_something(i.current()); i.next(); }
Here's the equivalent QListIterator loop:
QList<QWidget *> list; ... QListIterator<QWidget *> i(list); while (i.hasNext()) do_something(i.next());
Finally, QPtrListStdIterator<T> must also be ported. This is easy, because QList also provides STL-style iterators (QList::iterator and QList::const_iterator).
QPtrQueue has been moved to the Qt3Support library. It has been replaced by the more modern QQueue class.
The following table summarizes the differences between QPtrQueue<T> and QQueue<T *>:
QPtrQueue function | QQueue equivalent |
---|---|
QPtrQueue::autoDelete() | See discussion below |
QPtrQueue::count() | QQueue::count() or QQueue::size() (equivalent) |
QPtrQueue::current() | QQueue::head() |
QPtrQueue::remove() | QQueue::dequeue() |
QPtrQueue::setAutoDelete() | See discussion below |
If you use QPtrQueue's auto-delete feature (by calling QPtrQueue::setAutoDelete(true)), you need to do some more work. You have two options: Either you call delete yourself whenever you remove an item from the container, or you can use QQueue<T> instead of QQueue<T *> (i.e. store values directly instead of pointers to values). Here, we will show when to call delete.
QPtrQueue idiom | QQueue idiom |
---|---|
queue.dequeue(); | delete queue.dequeue(); |
queue.remove(); | delete queue.dequeue(); |
queue.clear(); (also called from QPtrQueue's destructor) | while (!queue.isEmpty()) delete queue.dequeue(); In 99% of cases, the following idiom also works: qDeleteAll(queue); queue.clear(); However, it may lead to crashes if queue is referenced from the value type's destructor, because queue contains dangling pointers until clear() is called. |
QPtrStack has been moved to the Qt3Support library. It has been replaced by the more modern QStack class.
The following table summarizes the differences between QPtrStack<T> and QStack<T *>:
QPtrStack function | QStack equivalent |
---|---|
QPtrStack::autoDelete() | See discussion below |
QPtrStack::count() | QStack::count() or QStack::size() (equivalent) |
QPtrStack::current() | QStack::top() |
QPtrStack::remove() | QStack::pop() |
QPtrStack::setAutoDelete() | See discussion below |
If you use QPtrStack's auto-delete feature (by calling QPtrStack::setAutoDelete(true)), you need to do some more work. You have two options: Either you call delete yourself whenever you remove an item from the container, or you can use QStack<T> instead of QStack<T *> (i.e. store values directly instead of pointers to values). Here, we will show when to call delete.
QPtrStack idiom | QStack idiom |
---|---|
stack.pop(); | delete stack.pop(); |
stack.remove(); | delete stack.pop(); |
stack.clear(); (also called from QPtrStack's destructor) | while (!stack.isEmpty()) delete stack.pop(); In 99% of cases, the following idiom also works: qDeleteAll(stack); stack.clear(); However, it may lead to crashes if stack is referenced from the value type's destructor, because stack contains dangling pointers until clear() is called. |
QPtrVector<T> has been moved to Qt3Support. It has been replaced by the more modern QVector class.
When porting to Qt 4, you can use QVector<T *> as an alternative to QPtrVector<T>. The APIs of QPtrVector<T> and QVector<T *> are somewhat similar. The main issue is that QPtrVector supports auto-delete whereas QVector doesn't.
The following table summarizes the API differences between the two classes:
QPtrVector function | QVector equivalent |
---|---|
QPtrVector::autoDelete() | See discussion below |
QPtrVector::bsearch(const T *) | qBinaryFind() |
QPtrVector::contains(const T *) | QVector::count(T *) |
QPtrVector::containsRef(const T *) | QVector::count(T *) |
QPtrVector::count() | See remark below |
QPtrVector::insert(uint, T *) | See remark below |
QPtrVector::isNull() | N/A |
QPtrVector::remove(uint) | See remark below |
QPtrVector::setAutoDelete() | See discussion below |
QPtrVector::sort() | qSort() |
QPtrVector::take(uint) | See remark below |
QPtrVector::toList(QGList *) | QList::QList(const QVector &) |
Remarks:
For example, if you have code like
int numValidItems = vect.count();
you can rewrite it as
int numValidItems = vect.size() - vect.count(0);
If you use QVector's auto-delete feature (by calling QVector::setAutoDelete(true)), you need to do some more work. You have two options: Either you call delete yourself whenever you remove an item from the container, or you use QVector<T> instead of QVector<T *> (i.e. store values directly instead of pointers to values). Here, we'll see when to call delete.
The following table summarizes the idioms that you need to watch out for if you want to call delete yourself.
QPtrVector idiom | QVector idiom |
---|---|
vect.insert(i, ptr); | delete vect[i]; vect[i] = ptr; |
vect.remove(i); | delete vect[i]; vect[i] = 0; |
T *ptr = vect.take(i); | T *ptr = vect[i]; vect[i] = 0; |
vect.resize(n) | while (n > vect.size()) vect.append(0); while (n < vect.size() { T *ptr = vect.last(); vect.remove(vect.size() - 1); delete ptr; } |
vect.clear(); (also called from QPtrVector's destructor) | for (int i = 0; i < vect.size(); ++i) T *ptr = vect[i]; vect[i] = 0; delete ptr; } In 99% of cases, the following idiom also works: qDeleteAll(vect); vect.clear(); However, it may lead to crashes if vect is referenced from the value type's destructor, because vect contains dangling pointers until clear() is called. |
Be aware that QPtrVector's destructor automatically calls clear(). If you have a QPtrVector data member in a custom class and use the auto-delete feature, you will need to call delete on all the items in the container from your class destructor to avoid a memory leak.
See Properties for a list of QPushButton properties in Qt 3 that have changed in Qt 4.
In Qt 3, various "range control" widgets (QDial, QScrollBar, QSlider, and QSpin) inherited from both QWidget and QRangeControl.
In Qt 4, QRangeControl has been replaced with the new QAbstractSlider and QAbstractSpinBox classes, which inherit from QWidget and provides similar functionality. Apart from eliminating unnecessary multiple inheritance, the new design allows QAbstractSlider to provide signals, slots, and properties.
The old QRangeControl class has been renamed Q3RangeControl and moved to the Qt3Support library, together with the (undocumented) QSpinWidget class.
If you use QRangeControl as a base class in your application, you can switch to use QAbstractSlider or QAbstractSpinBox instead.
For example, if you have code like
class VolumeControl : public QWidget, public QRangeControl { ... protected: void valueChange() { update(); emit valueChanged(value()); } void rangeChange() { update(); } void stepChange() { update(); } };
you can rewrite it as
class VolumeControl : public QAbstractSlider { ... protected: void sliderChange(SliderChange change) { update(); if (change == SliderValueChange) emit valueChanged(value()); } };
The search() and searchRev() functions have been renamed to indexIn() and lastIndexIn() respectively.
The following changes have been made to QRegion in Qt 4:
See Properties for a list of QScrollBar properties in Qt 3 that have changed in Qt 4.
The QScrollView class has been renamed Q3ScrollView and moved to the Qt3Support library. It has been replaced by the QAbstractScrollArea and QScrollArea classes.
Note that Qt 4 in general uses the QScrollArea::widget() function where Qt 3 used QScrollView::viewport(). The rationale for this is that it is no longer possible to draw directly on a scroll area. The QScrollArea::widget() function returns the widget set on the scroll area.
QScrollView was designed to work around the 16-bit limitation on widget coordinates found on most window systems. In Qt 4, this is done transparently for all widgets, so there is no longer a need for such functionality in QScrollView. For that reason, the new QAbstractScrollArea and QScrollArea classes are much more lightweight, and concentrate on handling scroll bars.
The QServerSocket class has been renamed Q3ServerSocket and moved to the Qt3Support library. In Qt 4, it has been replaced by QTcpServer.
With Q3ServerSocket, connections are accepted by reimplementing a virtual function (Q3ServerSocket::newConnection()). With QTcpServer, on the other hand, you don't need to subclass. Instead, simply connect to the QTcpServer::newConnection() signal.
The QSettings class has been rewritten to be more robust and to respect existing standards (e.g., the INI file format). The API has also been extensively revised. The old API is still provided when Qt 3 support is enabled.
Since the format and location of settings have changed between Qt 3 and Qt 4, the Qt 4 version of your application won't recognize settings written using Qt 3.
The QShared class has been obsoleted by the more powerful QSharedData and QSharedDataPointer as a means of creating custom implicitly shared classes. It has been renamed Q3Shared moved to the Qt3Support library.
An easy way of porting to Qt 4 is to include this class into your project and to use it instead of QShared:
struct Shared { Shared() : count(1) {} void ref() { ++count; } bool deref() { return !--count; } uint count; };
If possible, we recommend that you use QSharedData and QSharedDataPointer instead. They provide thread-safe reference counting and handle all the reference counting behind the scenes, eliminating the risks of forgetting to increment or decrement the reference count.
The QSignal class has been renamed to Q3Signal and moved to the Qt3Support library. The preferred approach is to create your own QObject subclass with a signal that has the desired signature. Alternatively, you can call QMetaObject::invokeMethod() if you want to invoke a slot.
The QSimpleRichText class has been renamed Q3SimpleRichText and moved to the Qt3Support library.
See Rich Text Processing for an overview of the Qt 4 rich text classes.
The QSlider::sliderStart() and QSlider::sliderRect() functions have been removed. You can retrieve this information using QAbstractSlider::sliderPosition() and QStyle::querySubControlMetrics(), respectively.
In addition, the direction of a vertical QSlider has changed, i.e. the bottom is now the minimum, and the top the maximum. You can use the QAbstractSlider::invertedAppearance property to control this behavior.
See Properties for a list of QSlider properties in Qt 3 that have changed in Qt 4.
The QSocket class has been renamed Q3Socket and moved to the Qt3Support library. In Qt 4, it has been replaced by the QTcpSocket class, which inherits most of its functionality from QAbstractSocket.
The QSocketDevice class has been renamed Q3SocketDevice and moved to the Qt3Support library. In Qt 4, there is no direct equivalent to Q3SocketDevice:
The QSortedList<T> class has been deprecated since Qt 3.0. In Qt 4, it has been moved to the Qt3Support library.
In new code, we recommend that you use QList<T> instead and use qSort() to sort the items.
The function setResizeMode() has been moved into Qt3Support. Set the stretch factor in the widget's size policy to get equivalent functionality.
The obsolete function drawSplitter() has been removed. Use QStyle::drawPrimitive() to acheive similar functionality.
See Properties for a list of QSpinBox properties in Qt 3 that have changed in Qt 4.
The QSqlCursor class has been renamed Q3SqlCursor and moved to the Qt3Support library. In Qt 4, you can use QSqlQuery, QSqlQueryModel, or QSqlTableModel, depending on whether you want a low-level or a high-level interface for accessing databases.
See QtSql Module for an overview of the new SQL classes.
QSqlDatabase is now a smart pointer that is passed around by value. Simply replace all QSqlDatabase pointers by QSqlDatabase objects.
The QSqlEditorFactory class has been renamed Q3SqlEditorFactory and moved to Qt3Support.
See QtSql Module for an overview of the new SQL classes.
The enum Type was renamed to ErrorType, The values were renamed as well:
The QSqlFieldInfo class has been moved to Qt3Support. Its functionality is now provided by the QSqlField class.
See QtSql Module for an overview of the new SQL classes.
The QSqlForm class has been renamed Q3SqlForm and moved to the Qt3Support library.
See QtSql Module for an overview of the new SQL classes.
The QSqlPropertyMap class has been renamed Q3SqlPropertyMap moved to the Qt3Support library.
See QtSql Module for an overview of the new SQL classes.
QSqlQuery::prev() was renamed to QSqlQuery::previous(). There is a function call for compatibility, but if you subclassed QSqlQuery, you have to reimplement previous() instead of prev().
QSqlRecord behaves like a vector now, QSqlRecord::insert() will actually insert a new field instead of replacing the existing one.
The QSqlRecordInfo class has been moved to Qt3Support. Its functionality is now provided by the QSqlRecord class.
See QtSql Module for an overview of the new SQL classes.
The QSqlSelectCursor class has been renamed Q3SqlSelectCursor and moved to the Qt3Support library.
See QtSql Module for an overview of the new SQL classes.
The QStoredDrag class has been renamed Q3StoredDrag and moved to the Qt3Support library. In Qt 4, use QMimeData instead and call QMimeData::setData() to set the data.
See Porting to Qt 4 (Drag and Drop) for a comparison between the drag and drop APIs in Qt 3 and Qt 4.
The QStrList and QStrIList convenience classes have been deprecated since Qt 2.0. In Qt 4, they have been moved to the Qt3Support library. If you used any of these, we recommend that you use QStringList or QList<QByteArray> instead.
The QStrVec and QStrIVec convenience classes have been deprecated since Qt 2.0. In Qt 4, they have been moved to Qt3Support. If you used any of these, we recommend that you use QStringList or QList<QByteArray> instead.
Here are the main issues to be aware of when porting QString to Qt 4:
For example, if you have code like
str1 = QString::null; if (str2 == QString::null) do_something(QString::null);
you can rewrite it as
str1.clear(); if (str2.isNull()) do_something(QString());
In new code, we recommend that you don't rely on the distinction between a null string and a (non-null) empty string. See Distinction Between Null and Empty Strings for details.
To obtain a const char * pointer to ASCII or Latin-1 data, use QString::toAscii() or QString::toLatin1() to obtain a QByteArray containing the data, then call QByteArray::constData() to access the character data directly. Note that the pointer returned by this function is only valid for the lifetime of the byte array; you should avoid taking a pointer to the data contained in temporary objects.
QString greeting = "Hello";
const char *badData = greeting.toAscii().constData(); // data is invalid
QByteArray asciiData = greeting.toAscii();
const char *goodData = asciiData.constData();
In the above example, the goodData pointer is valid for the lifetime of the asciiData byte array. If you need to keep a copy of the data in a non-Qt data structure, use standard C memory allocation and string copying functions to do so before destroying the byte array.
str.at(0) = 'X';
will no longer compile. Instead, use QString::operator[]:
str[0] = 'X';
For example, if you have code like
if (url.startsWith("http:", false)) ...
you can rewrite it as
if (url.startsWith("http:", Qt::CaseInsensitive)) ...
For example, if you have code like
str.setExpand(32, '$');
you can rewrite it as
str[32] = '$';
QStringList now inherits from QList<QString> and can no longer be converted to a QValueList<QString>. Since QValueList inherits QList a cast will work as expected.
This change implies some API incompatibilities for QStringList. For example, at() returns the string, not an iterator. See the section on QValueList for details.
The static QStringList::split() function for splitting strings into lists of smaller strings has been replaced by QString::split(), which returns a QStringList.
The QStyle API has been overhauled and improved. Most of the information on why this change was done is described in the QStyle overview.
Since QStyle is mostly used internally by Qt's widgets and styles and since it is not essential to the good functioning of an application, there is no compatibility path. This means that we have changed many enums and functions and the qt3to4 porting tool will not change much in your qstyle code. To ease the pain, we list some of the major changes here.
QStyleOption has taken on a more central role and is no longer an optional argument, please see the QStyleOption documentation for more information.
The QStyle::StyleFlags have been renamed QStyle::StateFlags and are now prefixed State_ instead of Style_, in addition the Style_ButtonDefault flag has moved to QStyleOptionButton.
The QStyle::PrimitiveElement enumeration has undergone extensive change. Some of the enums were moved to QStyle::ControlElement, some were removed and all were renamed. This renaming is not done by the qt3to4 porting tool, so you must do it yourself. The table below shows how things look now.
The QStyle::drawControlMask() and QStyle::drawComplexControlMask() functions have been removed. They are replaced with a style hint.
The QStyle::drawItem() overloads that took both a pixmap and a string have been removed. Use QStyle::drawItemText() and QStyle::drawItemPixmap() directly.
The QStyle::itemRect() overload that took both a pixmap and a string is also removed, use either QStyle::itemTextRect() or QStyle::itemPixmapRect() instead.
The QStyleSheet and QStyleSheetItem classes have been renamed Q3StyleSheet and Q3StyleSheetItem, and have been moved to the Qt3Support library.
See Rich Text Processing for an overview of the Qt 4 rich text classes, and Qt Style Sheets for a description of CSS-like style sheet support in Qt 4.2 and above.
The QSyntaxHighlighter class from Qt 3 has been renamed Q3SyntaxHighlighter and moved to the Qt3Support library. Since Qt 4.1, it has been replaced by a new QSyntaxHighlighter class based on Qt 4's new rich text engine.
See Properties for a list of QTabBar properties in Qt 3 that have changed in Qt 4.
The QTabDialog class is no longer part of the public Qt API. It has been renamed Q3TabDialog and moved to Qt3Support. In Qt 4 applications, you can easily obtain the same result by combining a QTabWidget with a QDialog and provide QPushButtons yourself.
See also the dialogs/tabdialog example, which shows how to implement tab dialogs in Qt 4.
See Properties for a list of QTabWidget properties in Qt 3 that have changed in Qt 4.
The QTable, QTableItem, QComboTableItem, QCheckTableItem, and QTableSelection classes have been renamed Q3Table, Q3TableItem, Q3ComboTableItem, Q3CheckTableItem, and Q3TableSelection and moved to the Qt3Support library. New Qt applications should use the new QTableWidget or QTableView class instead.
Some of these classes behave differently with respect to the way they handle NULL pointers. For example, Q3TableItem::setPixmap() no longer accepts NULL or 0 to indicate that the item should contain a null pixmap; in this case, a null pixmap should be constructed and passed explicitly to the function.
See Model/View Programming for an overview of the new item view classes.
The loadCharmap() and loadCharmapFromFile() functions are no longer available in Qt 4. You need to create your own codec if you want to create a codec based on a POSIX2 charmap definition.
The QTextDrag class has been renamed Q3TextDrag and moved to the Qt3Support library. In Qt 4, use QMimeData instead and call QMimeData::setText() to set the data.
See Porting to Qt 4 (Drag and Drop) for a comparison between the drag and drop APIs in Qt 3 and Qt 4.
The old QTextEdit and QTextBrowser classes have been renamed Q3TextEdit and Q3TextBrowser, and have been moved to Qt3Support. The new QTextEdit and QTextBrowser have a somewhat different API.
The QTextEdit::setWrapPolicy() function has been renamed to setWordWrapMode() and the QTextEdit::setWrapColumnOrWidth() function has been renamed to setLineWrapColumnOrWidth(). The Q3TextEdit::setWrapPolicy() and Q3TextEdit::setWrapColumnOrWidth() still provide this functionality in the Q3TextEdit class.
See Rich Text Processing for an overview of the Qt 4 rich text classes.
The QTextIStream convenience class is no longer provided in Qt 4. Use QTextStream directly instead.
The QTextOStream convenience class is no longer provided in Qt 4. Use QTextStream directly instead.
The undocumented QTextOStreamIterator class has been removed from the Qt library. If you need it in your application, feel free to copy the source code from the Qt 3 <qtl.h> header file.
QTextStream has undergone a number of API and implementation enhancements, and some of the changes affect QTextStream's behavior:
Note that when using a QTextStream on a QFile in Qt 4, calling QIODevice::reset() on the QFile will not have the expected result because QTextStream now buffers the file. Use the QTextStream::seek() function instead.
The QTextView class has been renamed Q3TextView and moved to the Qt3Support library.
The QTimeEdit class in Qt 4 is a convenience class based on QDateTimeEdit. The old class has been renamed Q3TimeEdit and moved to the Qt3Support library.
See Virtual Functions for a list of QTimeEdit virtual member functions in Qt 3 that are no longer virtual in Qt 4.
Windows restricts the granularity of timers, but starting with Qt 4, we emulate a finer time resolution. On Windows XP we use the multimedia timer API, which gives us 1 millisecond resolution for QTimer.
Note that other versions of Windows have a lower timer resolution, and that code relying on underlying system timer restrictions encounters no such limitations using Qt 4 (e.g., setting an interval of 0 millisecond results in Qt occupying all of the processor time when no GUI events need processing).
The old QToolBar class, which worked with the old QMainWindow and QDockArea classes and inherited from QDockWindow, has been renamed Q3ToolBar and moved to Qt3Support. Note that, when using Q3ToolBar, the toolbar's actions must be Q3Actions.
Use the new QToolBar class in new applications.
Note: Q3ToolBar's horizontallyStretchable property can be achieved in QToolBar with size policies.
See Properties for a list of QToolBar properties in Qt 3 that have changed in Qt 4.
Note that many of the properties that could previously be set in the constructor must now be set separately.
The QToolTip::setGloballyEnabled() function no longer exists. Tooltips can be disabled by installing an event filter on qApp (the unique QApplication object) to block events of type QEvent::ToolTip.
The QUriDrag class has been renamed Q3UriDrag and moved to the Qt3Support library. In Qt 4, use QMimeData instead and call QMimeData::setUrl() to set the URL.
See Porting to Qt 4 (Drag and Drop) for a comparison between the drag and drop APIs in Qt 3 and Qt 4.
The QUrl class has been rewritten from scratch in Qt 4 to be more standard-compliant. The old QUrl class has been renamed Q3Url and moved to the Qt3Support library.
The new QUrl class provides an extensive list of compatibility functions to ease porting from Q3Url to QUrl. A few functions require you to change your code:
The QUrlOperator class is no longer part of the public Qt API. It has been renamed Q3UrlOperator and moved to Qt3Support.
In Qt 4 applications, you can use classes like QFtp and QHttp directly to perform file-related actions on a remote host.
The QValueList<T> class has been replaced by QList<T> and QLinkedList<T> in Qt 4. As a help when porting older Qt applications, the Qt3Support library contains a QValueList<T> class implemented in terms of the new QLinkedList<T>. Similarly, it contains QValueListIterator<T> and QValueListConstIterator<T> classes implemented in terms of QLinkedList<T>::iterator and QLinkedList<T>::const_iterator.
When porting to Qt 4, you have the choice of using QList<T> or QLinkedList<T> as alternatives to QValueList<T>. QList<T> has an index-based API and provides very fast random access (QList::operator[]), whereas QLinkedList<T> has an iterator-based API.
Here's a list of problem functions:
For example, if you have code like
for (QValueList<T>::iterator i = list.fromLast(); i != list.begin(); --i) do_something(*i);
you can rewrite it as
QLinkedList<T>::iterator i = list.end();
while (i != list.begin()) {
--i; // decrement i before using it
do_something(*i);
}
The QValueVector<T> class has been replaced by QVector<T> in Qt 4. As a help when porting older Qt applications, the Qt3Support library contains a Q3ValueVector<T> class implemented in terms of the new QVector<T>.
When porting from QValueVector<T> to QVector<T>, you might run into the following incompatibilities:
See Generic Containers for an overview of the Qt 4 container classes.
Some changes to the rest of the Qt library have implications on QVariant:
Also, the QVariant(bool, int) constructor has been replaced by QVariant(bool). Old code like QVariant(true, 0) should be replaced with QVariant(true); otherwise, the QVariant(int, void *) overload might accidentally be triggered.
The QVBox class is now only available as Q3VBox in Qt 4. You can achieve the same result as QVBox by creating a QWidget with a vertical layout:
For example, if you have code like
QVBox *vbox = new QVBox; QPushButton *child1 = new QPushButton(vbox); QPushButton *child2 = new QPushButton(vbox);
you can rewrite it as
QWidget *vbox = new QWidget; QPushButton *child1 = new QPushButton; QPushButton *child2 = new QPushButton; QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(child1); layout->addWidget(child2); vbox->setLayout(layout);
Note that child widgets are not automatically placed into the widget's layout; you will need to manually add each widget to the QVBoxLayout.
The QVGroupBox class has been renamed Q3VGroupBox and moved to the Qt3Support library. Qt 4 does not provide a specific replacement class for QVGroupBox since QGroupBox is designed to be a generic container widget. As a result, you need to supply your own layout for any child widgets.
See #QGroupBox for more information about porting code that uses group boxes.
The QWhatsThis class has been redesigned in Qt 4. The old QWhatsThis class is available as Q3WhatsThis in Qt3Support.
Widget background painting has been greatly improved, supporting flicker-free updates and making it possible to have semi-transparent widgets. This renders the following background handling functions obsolete:
A widget now receives change events in its QWidget::changeEvent() handler. This makes the following virtual change handlers obsolete:
The following functions were slots, but are no more:
The following functions were incorrectly marked as virtual:
The internal clearWState() function was removed. Use QWidget::setWindowState() instead.
setWFlags() was renamed QWidget::setWindowFlags().
See Properties for a list of QWidget properties in Qt 3 that have changed in Qt 4.
The QWidgetFactory class has been replaced by QFormBuilder in Qt 4.
The QWidgetIntDict class was a synonym for QIntDict<QWidget>. It is no longer available in Qt 4. If you link against Qt3Support, you can use QIntDict<QWidget> instead; otherwise, see the section on QDict<T>.
In Qt 3, the QWidgetList class was a typedef for QPtrList<QWidget>. In Qt 4, it is a typedef for QList<QWidget *>. See the section on QPtrList<T>.
The QWidgetPlugin class is no longer available in Qt 4. To create custom widget plugins, subclass QDesignerCustomWidgetInterface to provide information about the custom widget, and build a plugin in the way described in the Custom Widget Plugin example.
The QWidgetStack class is no longer part of the Qt public API. It has been renamed Q3WidgetStack and moved to Qt3Support. In Qt 4 applications, you can use QStackedWidget instead to obtain the same results.
The QWizard class is no longer part of the Qt public API. It has been renamed Q3Wizard and moved to Qt3Support. In Qt 4 applications, you can obtain the same result by combining a QStackedWidget with a QDialog and provide QPushButtons yourself.
There is also a QtWizard solution available from Trolltech. The new class was designed to work both for linear wizards and for wizards with more complex structures which let users reach different pages depending on the options they select. Based on the feedback we get, QtWizard may be considered for inclusion in a future Qt release.
The QWorkspace in Qt 4 class requires explicit adding of MDI windows with QWorkspace::addWindow().
Virtual functions that changed their signature in Qt 4:
Qt 3 function signature | Qt 4 function signature |
---|---|
int QAccessibleInterface::navigate(NavDirection, int) const | int QAccessibleInterface::navigate(RelationFlag, int, QAccessibleInterface **) const |
bool QApplication::winEventFilter(MSG *) | bool QApplication::winEventFilter(MSG *, long *) |
Function: Offset QIODevice::at() const | Function: Q_LONGLONG QIODevice::pos() const |
bool QIODevice::at(Offset) | bool QIODevice::seek(Q_LONGLONG) |
bool QIODevice::open(int) | bool QIODevice::open(OpenMode) |
Q_LONG QIODevice::readBlock(char *, Q_ULONG) | Q_LONGLONG QIODevice::readData(char *, Q_LONGLONG) |
Q_LONG QIODevice::writeBlock(const char *, Q_ULONG) | Q_LONGLONG QIODevice::writeData(const char *, Q_LONGLONG) |
const char * QImageFormatType::formatName() const | QByteArray QImageFormatType::formatName() const |
QPopupMenu * QLineEdit::createPopupMenu() | QMenu * QLineEdit::createPopupMenu() |
bool QMacMime::canConvert(const char *, int) | bool QMacMime::canConvert(const QString &, int) |
QValueList<QByteArray> QMacMime::convertFromMime(QByteArray, const char *, int) | QList<QByteArray> QMacMime::convertFromMime(QByteArray, const QString &, int) |
QByteArray QMacMime::convertToMime(QValueList<QByteArray> data, const char *, int) | QByteArray QMacMime::convertToMime(QList<QByteArray> data, const QString &, int) |
const char * QMacMime::convertorName() | QString QMacMime::convertorName() |
int QMacMime::flavorFor(const char *) | int QMacMime::flavorFor(const QString &) |
const char * QMacMime::mimeFor(int) | QString QMacMime::mimeFor(int) |
QMetaObject * QObject::metaObject() const | const QMetaObject * QObject::metaObject() const |
bool QScreen::onCard(unsigned char *) const | bool QScreen::onCard(const unsigned char *) const |
bool QScreen::onCard(unsigned char *, ulong &) const | bool QScreen::onCard(const unsigned char *, ulong &) const |
int QSpinBox::mapTextToValue(bool *) | int QSpinBox::mapTextToValue(QString *, QValidator::State *) const |
QString QSpinBox::mapValueToText(int) | QString QSpinBox::mapValueToText(int) const |
bool QSqlDriver::open(const QString &, const QString &, const QString &, const QString &, int) | bool QSqlDriver::open(const QString &, const QString &, const QString &, const QString &, int, const QString &) |
QStringList QSqlDriver::tables(const QString &) const | QStringList QSqlDriver::tables(QSql::TableType) const |
bool QSqlQuery::prev() | bool QSqlQuery::previous() |
QVariant QSqlResult::data(int) | QVariant QSqlResult::data(int) |
bool QSqlResult::fetchPrev() | bool QSqlResult::fetchPrevious() |
void QStyle::drawComplexControl(ComplexControl, QPainter *, const QWidget *, const QRect &, const QColorGroup &, SFlags, SCFlags, SCFlags, const QStyleOption &) const | void QStyle::drawComplexControl(ComplexControl, const QStyleOptionComplex *, QPainter *, const QWidget *) const |
void QStyle::drawComplexControlMask(ComplexControl, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const | void QStyle::drawComplexControlMask(ComplexControl, const QStyleOptionComplex *, QPainter *, const QWidget *) const |
void QStyle::drawControl(ControlElement, QPainter *, const QWidget *, const QRect &, const QColorGroup &, SFlags, const QStyleOption &) const | void QStyle::drawControl(ControlElement, const QStyleOption *, QPainter *, const QWidget *) const |
void QStyle::drawControlMask(ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const | void QStyle::drawControlMask(ControlElement, const QStyleOption *, QPainter *, const QWidget *) const |
void QStyle::drawItem(QPainter *, const QRect &, int, const QColorGroup &, bool, const QPixmap *, const QString &, int, const QColor *) const | void QStyle::drawItem(QPainter *, const QRect &, int, const QPalette &, bool, const QString &, int, const QColor *) const |
void QStyle::drawPrimitive(PrimitiveElement, QPainter *, const QRect &, const QColorGroup &, SFlags, const QStyleOption &) const | void QStyle::drawPrimitive(PrimitiveElement, const QStyleOption *, QPainter *, const QWidget *) const |
QRect QStyle::itemRect(QPainter *, const QRect &, int, bool, const QPixmap *, const QString &, int) const | QRect QStyle::itemRect(const QFontMetrics &, const QRect &, int, bool, const QString &, int) const |
int QStyle::pixelMetric(PixelMetric, const QWidget *) const | int QStyle::pixelMetric(PixelMetric, const QStyleOption *, const QWidget *) const |
SubControl QStyle::querySubControl(ComplexControl, const QWidget *, const QPoint &, const QStyleOption &) const | SubControl QStyle::hitTestComplexControl(ComplexControl, const QStyleOptionComplex *, const QPoint &, const QWidget *) const |
QRect QStyle::querySubControlMetrics(ComplexControl, const QWidget *, SubControl, const QStyleOption &) const | QRect QStyle::subControlRect(ComplexControl, const QStyleOptionComplex *, SubControl, const QWidget *) const |
QSize QStyle::sizeFromContents(ContentsType, const QWidget *, const QSize &, const QStyleOption &) const | QSize QStyle::sizeFromContents(ContentsType, const QStyleOption *, const QSize &, const QFontMetrics &, const QWidget *) const |
int QStyle::styleHint(StyleHint, const QWidget *, const QStyleOption &, QStyleHintReturn *) const | int QStyle::styleHint(StyleHint, const QStyleOption *, const QWidget *, QStyleHintReturn *) const |
QPixmap QStyle::stylePixmap(StylePixmap, const QWidget *, const QStyleOption &) const | QPixmap QStyle::standardPixmap(StandardPixmap, const QStyleOption *, const QWidget *) const |
QRect QStyle::subRect(SubRect, const QWidget *) const | QRect QStyle::subRect(SubRect, const QStyleOption *, const QFontMetrics &, const QWidget *) const |
void QStyle::unPolish(QApplication *) | void QStyle::unpolish(QApplication *) |
void QStyle::unPolish(QWidget *) | void QStyle::unpolish(QWidget *) |
QCString QTextCodec::fromUnicode(const QString &, int &) const | QByteArray QTextCodec::fromUnicode(const QString &, int &) const |
QValueList<int> QTextCodecPlugin::mibEnums() const | QList<int> QTextCodecPlugin::mibEnums() const |
void QTextDrag::setSubtype(const QCString &) | void QTextDrag::setSubtype(const QString &) |
QCString QTextEncoder::fromUnicode(const QString &, int &) | QByteArray QTextEncoder::fromUnicode(const QString &, int &) |
void QUriDrag::setUris(QStrList) | void QUriDrag::setUris(const QList<QByteArray> & list) |
void QUrlInfo::setSize(uint) | void QUrlInfo::setSize(Q_LONGLONG) |
bool QWindowsMime::canConvert(const char *, int) | bool QWindowsMime::canConvert(const QString &, int) |
int QWindowsMime::cfFor(const char *) | int QWindowsMime::cfFor(const QString &) |
QByteArray QWindowsMime::convertFromMime(QByteArray, const char *, int) | QByteArray QWindowsMime::convertFromMime(const QByteArray &, const QString &, int) |
QByteArray QWindowsMime::convertToMime(QByteArray, const char *, int) | QByteArray QWindowsMime::convertToMime(const QByteArray &, const QString &, int) |
const char * QWindowsMime::convertorName() | QString QWindowsMime::convertorName() |
void QWSMouseHandler::calibrate(QWSPointerCalibrationData *) | void QWSMouseHandler::calibrate(const QWSPointerCalibrationData *) |
bool QWidget::macEvent(MSG *) | bool QWidget::macEvent(EventHandlerCallRef, EventRef) |
bool QWidget::winEvent(MSG *) | bool QWidget::winEvent(MSG *, long *) |
QString QXmlContentHandler::errorString() | QString QXmlContentHandler::errorString() const |
QString QXmlDTDHandler::errorString() | QString QXmlDTDHandler::errorString() const |
QString QXmlDeclHandler::errorString() | QString QXmlDeclHandler::errorString() const |
QString QXmlEntityResolver::errorString() | QString QXmlEntityResolver::errorString() const |
QString QXmlErrorHandler::errorString() | QString QXmlErrorHandler::errorString() const |
QString QXmlInputSource::data() | QString QXmlInputSource::data() const |
QString QXmlLexicalHandler::errorString() | QString QXmlLexicalHandler::errorString() const |
int QXmlLocator::columnNumber() | int QXmlLocator::columnNumber() const |
int QXmlLocator::lineNumber() | int QXmlLocator::lineNumber() const |
Virtual functions that are not virtual in Qt 4:
Qt 3 function | Comment |
---|---|
void QAccessibleInterface::clearSelection() | Port to the new QAccessibleInterface API. |
int QAccessibleInterface::controlAt(int, int) const | Port to the new QAccessibleInterface API. |
bool QAccessibleInterface::doDefaultAction(int) | Port to the new QAccessibleInterface API. |
QMemArray<int> QAccessibleInterface::selection() const | Port to the new QAccessibleInterface API. |
bool QAccessibleInterface::setFocus(int) | Port to the new QAccessibleInterface API. |
bool QAccessibleInterface::setSelected(int, bool, bool) | Port to the new QAccessibleInterface API. |
bool QAction::addTo(QWidget *) | Use Q3Action instead or port to the new QAction API. |
void QAction::addedTo(QWidget *, QWidget *) | Use Q3Action instead or port to the new QAction API. |
void QAction::addedTo(int, QPopupMenu *) | Use Q3Action instead or port to the new QAction API. |
bool QAction::removeFrom(QWidget *) | Use Q3Action instead or port to the new QAction API. |
void QAction::setAccel(const QKeySequence &) | Use Q3Action instead or port to the new QAction API. |
void QAction::setEnabled(bool) | Use Q3Action instead or port to the new QAction API. |
void QAction::setIconSet(const QIcon &) | Use Q3Action instead or port to the new QAction API. |
void QAction::setMenuText(const QString &) | Use Q3Action instead or port to the new QAction API. |
void QAction::setOn(bool) | Use Q3Action instead or port to the new QAction API. |
void QAction::setStatusTip(const QString &) | Use Q3Action instead or port to the new QAction API. |
void QAction::setText(const QString &) | Use Q3Action instead or port to the new QAction API. |
void QAction::setToggleAction(bool) | Use Q3Action instead or port to the new QAction API. |
void QAction::setToolTip(const QString &) | Use Q3Action instead or port to the new QAction API. |
void QAction::setWhatsThis(const QString &) | Use Q3Action instead or port to the new QAction API. |
void QButton::drawButton(QPainter *) | Use Q3Button instead or reimplement QButton::paintEvent(). |
void QButton::drawButtonLabel(QPainter *) | Use Q3Button instead or reimplement QButton::paintEvent(). |
void QButton::setAccel(const QKeySequence &) | Setter. |
void QButton::setAutoRepeat(bool) | Setter. |
void QButton::setDown(bool) | Setter. |
void QButton::setPixmap(const QPixmap &) | Setter. |
void QButton::setState(ToggleState) | Setter. |
void QButton::setText(const QString &) | Use the QAbstractButton::setText() setter function. |
void QButton::setToggleType(ToggleType) | Setter. |
void QButtonGroup::moveFocus(int) | Use the QWidget::setFocus() setter function. |
void QButtonGroup::setButton(int) | Setter. |
void QButtonGroup::setExclusive(bool) | Setter. |
void QButtonGroup::setRadioButtonExclusive(bool) | Setter. |
void QComboBox::setAutoCompletion(bool) | Setter. |
void QComboBox::setAutoResize(bool) | Setter. |
void QComboBox::setCurrentItem(int) | Setter. |
void QComboBox::setCurrentText(const QString &) | Setter. |
void QComboBox::setFont(const QFont &) | Setter. |
void QComboBox::setInsertionPolicy(Policy) | Setter. |
void QComboBox::setLineEdit(QLineEdit *) | Setter. |
void QComboBox::setListBox(QListBox *) | Setter. |
void QComboBox::setMaxCount(int) | Setter. |
void QComboBox::setPalette(const QPalette &) | Setter. |
void QComboBox::setSizeLimit(int) | Setter. |
void QComboBox::setValidator(const QValidator *) | Setter. |
void QDateEdit::fix() | Port to the new QDateTimeEdit API. |
QString QDateEdit::sectionFormattedText(int) | Port to the new QDateTimeEdit API. |
void QDateEdit::setAutoAdvance(bool) | Port to the new QDateTimeEdit API. |
void QDateEdit::setDate(const QDate &) | Port to the new QDateTimeEdit API. |
void QDateEdit::setDay(int) | Port to the new QDateTimeEdit API. |
void QDateEdit::setMaxValue(const QDate &) | Port to the new QDateTimeEdit API. |
void QDateEdit::setMinValue(const QDate &) | Port to the new QDateTimeEdit API. |
void QDateEdit::setMonth(int) | Port to the new QDateTimeEdit API. |
void QDateEdit::setOrder(Order) | Port to the new QDateTimeEdit API. |
void QDateEdit::setRange(const QDate &, const QDate &) | Port to the new QDateTimeEdit API. |
void QDateEdit::setSeparator(const QString &) | Port to the new QDateTimeEdit API. |
void QDateEdit::setYear(int) | Port to the new QDateTimeEdit API. |
void QDateTimeEdit::setAutoAdvance(bool) | Port to the new QDateTimeEdit API. |
void QDateTimeEdit::setDateTime(const QDateTime &) | Port to the new QDateTimeEdit API. |
void QDial::rangeChange() | Reimplement QDial::sliderChange() instead. |
void QDial::repaintScreen(const QRect *) | Reimplement QDial::paintEvent() instead. |
void QDial::setNotchTarget(double) | Setter. |
void QDial::setNotchesVisible(bool) | Setter. |
void QDial::setTracking(bool) | Setter. |
void QDial::setValue(int) | Use QDial::sliderChange() instead. |
void QDial::setWrapping(bool) | Setter. |
void QDial::valueChange() | Use QDial::sliderChange() instead. |
QString QDir::absFilePath(const QString &, bool) const | Value type. |
QString QDir::absPath() const | Value type. |
QString QDir::canonicalPath() const | Value type. |
bool QDir::cd(const QString &, bool) | Value type. |
bool QDir::cdUp() | Value type. |
void QDir::convertToAbs() | Value type. |
QString QDir::dirName() const | Value type. |
QStrList QDir::encodedEntryList(int, int) const | Value type. |
QStrList QDir::encodedEntryList(const QString &, int, int) const | Value type. |
const QFileInfoList * QDir::entryInfoList(int, int) const | Value type. |
const QFileInfoList * QDir::entryInfoList(const QString &, int, int) const | Value type. |
QStringList QDir::entryList(const QString &, int, int) const | Value type. |
QStringList QDir::entryList(int, int) const | Value type. |
bool QDir::exists() const | Value type. |
bool QDir::exists(const QString &, bool) | Value type. |
QString QDir::filePath(const QString &, bool) const | Value type. |
bool QDir::isReadable() const | Value type. |
bool QDir::isRelative() const | Value type. |
bool QDir::isRoot() const | Value type. |
bool QDir::mkdir(const QString &, bool) const | Value type. |
bool QDir::operator!=() const | Value type. |
bool QDir::operator==() const | Value type. |
QString QDir::path() const | Value type. |
bool QDir::remove(const QString &, bool) | Value type. |
bool QDir::rename(const QString &, const QString &, bool) | Value type. |
bool QDir::rmdir(const QString &, bool) const | Value type. |
void QDir::setFilter(int) | Value type. |
void QDir::setMatchAllDirs(bool) | Value type. |
void QDir::setNameFilter(const QString &) | Value type. |
void QDir::setPath(const QString &) | Value type. |
void QDir::setSorting(int) | Value type. |
void QDns::setLabel(const QString &) | Use Q3Dns instead. |
void QDns::setLabel(const QHostAddress &) | Use Q3Dns instead. |
void QDns::setRecordType(RecordType) | Use Q3Dns instead. |
void QDockWindow::dock() | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setCloseMode(int) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setFixedExtentHeight(int) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setFixedExtentWidth(int) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setHorizontallyStretchable(bool) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setMovingEnabled(bool) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setNewLine(bool) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setOffset(int) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setOpaqueMoving(bool) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setOrientation(Orientation) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setResizeEnabled(bool) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setVerticallyStretchable(bool) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::setWidget(QWidget *) | Use Q3DockWindow instead or port to the new QDockWidget API. |
void QDockWindow::undock() | Use Q3DockWindow instead or port to the new QDockWidget API. |
QString QDomAttr::name() const | Value type. |
QDomElement QDomAttr::ownerElement() const | Value type. |
void QDomAttr::setValue(const QString &) | Value type. |
bool QDomAttr::specified() const | Value type. |
QString QDomAttr::value() const | Value type. |
void QDomCharacterData::appendData(const QString &) | Value type. |
QString QDomCharacterData::data() const | Value type. |
void QDomCharacterData::deleteData(unsigned, unsigned) | Value type. |
void QDomCharacterData::insertData(unsigned, const QString &) | Value type. |
uint QDomCharacterData::length() const | Value type. |
void QDomCharacterData::replaceData(unsigned, unsigned, const QString &) | Value type. |
void QDomCharacterData::setData(const QString &) | Value type. |
QString QDomCharacterData::substringData(unsigned, unsigned) | Value type. |
QDomNamedNodeMap QDomDocumentType::entities() const | Value type. |
QString QDomDocumentType::internalSubset() const | Value type. |
QString QDomDocumentType::name() const | Value type. |
QDomNamedNodeMap QDomDocumentType::notations() const | Value type. |
QString QDomDocumentType::publicId() const | Value type. |
QString QDomDocumentType::systemId() const | Value type. |
QDomNamedNodeMap QDomElement::attributes() const | Value type. |
QDomNodeList QDomElement::elementsByTagName(const QString &) const | Value type. |
QDomNodeList QDomElement::elementsByTagNameNS(const QString &, const QString &) const | Value type. |
QString QDomEntity::notationName() const | Value type. |
QString QDomEntity::publicId() const | Value type. |
QString QDomEntity::systemId() const | Value type. |
QDomDocument QDomImplementation::createDocument(const QString &, const QString &, const QDomDocumentType &) | Value type. |
QDomDocumentType QDomImplementation::createDocumentType(const QString &, const QString &, const QString &) | Value type. |
bool QDomImplementation::hasFeature(const QString &, const QString &) | Value type. |
QDomImplementation::~QDomImplementation() | Value type. |
QDomNode QDomNode::appendChild(const QDomNode &) | Value type. |
QDomNamedNodeMap QDomNode::attributes() const | Value type. |
QDomNodeList QDomNode::childNodes() const | Value type. |
QDomNode QDomNode::cloneNode(bool) const | Value type. |
QDomNode QDomNode::firstChild() const | Value type. |
bool QDomNode::hasAttributes() const | Value type. |
bool QDomNode::hasChildNodes() const | Value type. |
QDomNode QDomNode::insertAfter(const QDomNode &, const QDomNode &) | Value type. |
QDomNode QDomNode::insertBefore(const QDomNode &, const QDomNode &) | Value type. |
bool QDomNode::isAttr() const | Value type. |
bool QDomNode::isCDATASection() const | Value type. |
bool QDomNode::isCharacterData() const | Value type. |
bool QDomNode::isComment() const | Value type. |
bool QDomNode::isDocument() const | Value type. |
bool QDomNode::isDocumentFragment() const | Value type. |
bool QDomNode::isDocumentType() const | Value type. |
bool QDomNode::isElement() const | Value type. |
bool QDomNode::isEntity() const | Value type. |
bool QDomNode::isEntityReference() const | Value type. |
bool QDomNode::isNotation() const | Value type. |
bool QDomNode::isProcessingInstruction() const | Value type. |
bool QDomNode::isSupported(const QString &, const QString &) const | Value type. |
bool QDomNode::isText() const | Value type. |
QDomNode QDomNode::lastChild() const | Value type. |
QString QDomNode::localName() const | Value type. |
QString QDomNode::namespaceURI() const | Value type. |
QDomNode QDomNode::nextSibling() const | Value type. |
QString QDomNode::nodeName() const | Value type. |
QDomNode::NodeType QDomNode::nodeType() const | Value type. |
QString QDomNode::nodeValue() const | Value type. |
void QDomNode::normalize() | Value type. |
QDomDocument QDomNode::ownerDocument() const | Value type. |
QDomNode QDomNode::parentNode() const | Value type. |
QString QDomNode::prefix() const | Value type. |
QDomNode QDomNode::previousSibling() const | Value type. |
QDomNode QDomNode::removeChild(const QDomNode &) | Value type. |
QDomNode QDomNode::replaceChild(const QDomNode &, const QDomNode &) | Value type. |
void QDomNode::setNodeValue(const QString &) | Value type. |
void QDomNode::setPrefix(const QString &) | Value type. |
QDomNode::~QDomNode() | Value type. |
QDomNode QDomNodeList::item(int) const | Value type. |
uint QDomNodeList::length() const | Value type. |
QDomNodeList::~QDomNodeList() | Value type. |
QString QDomProcessingInstruction::data() const | Value type. |
void QDomProcessingInstruction::setData(const QString &) | Value type. |
QString QDomProcessingInstruction::target() const | Value type. |
int QEventLoop::enterLoop() | Port to the new QAbstractEventDispatcher API. |
int QEventLoop::exec() | Port to the new QAbstractEventDispatcher API. |
void QEventLoop::exit(int) | Port to the new QAbstractEventDispatcher API. |
void QEventLoop::exitLoop() | Port to the new QAbstractEventDispatcher API. |
bool QEventLoop::hasPendingEvents() const | Port to the new QAbstractEventDispatcher API. |
int QEventLoop::loopLevel() const | Port to the new QAbstractEventDispatcher API. |
bool QEventLoop::processEvents(ProcessEventsFlags) | Port to the new QAbstractEventDispatcher API. |
void QEventLoop::registerSocketNotifier(QSocketNotifier *) | Port to the new QAbstractEventDispatcher API. |
void QEventLoop::unregisterSocketNotifier(QSocketNotifier *) | Port to the new QAbstractEventDispatcher API. |
void QEventLoop::wakeUp() | Port to the new QAbstractEventDispatcher API. |
void QFrame::drawContents(QPainter *) | Use Q3Frame or reimplement QFrame::paintEvent() instead. |
void QFrame::drawFrame(QPainter *) | Use Q3Frame or reimplement QFrame::paintEvent() instead. |
void QFrame::frameChanged() | Use Q3Frame or reimplement QFrame::resizeEvent() instead. |
void QFrame::setFrameRect(const QRect &) | Setter. |
void QFrame::setFrameStyle(int) | Setter. |
void QFrame::setLineWidth(int) | Setter. |
void QFrame::setMargin(int) | Setter. |
void QFrame::setMidLineWidth(int) | Setter. |
void QGridLayout::setColStretch(int, int) | Setter. |
void QGridLayout::setRowStretch(int, int) | Setter. |
void QGroupBox::setAlignment(int) | Setter. |
void QGroupBox::setColumnLayout(int, Orientation) | Setter. |
void QGroupBox::setTitle(const QString &) | Setter. |
QHostAddress::~QHostAddress() | Value type. |
int QIODevice::getch() | Port to the new QIODevice API. |
int QIODevice::putch(int) | Port to the new QIODevice API. |
QByteArray QIODevice::readAll() | Port to the new QIODevice API. |
Q_LONG QIODevice::readLine(char *, Q_ULONG) | Port to the new QIODevice API. |
int QIODevice::ungetch(int) | Port to the new QIODevice API. |
void QIcon::setPixmap(const QString &, Size, Mode, State) | Value type. |
void QIcon::setPixmap(const QPixmap &, Size, Mode, State) | Value type. |
QIcon::~QIcon() | Value type. |
void QLabel::setAlignment(int) | Setter. |
void QLabel::setAutoResize(bool) | Setter. |
void QLabel::setBuddy(QWidget *) | Setter. |
void QLabel::setMovie(const QMovie &) | Setter. |
void QLabel::setNum(int) | Setter. |
void QLabel::setNum(double) | Setter. |
void QLabel::setPicture(const QPicture &) | Setter. |
void QLabel::setPixmap(const QPixmap &) | Setter. |
void QLabel::setText(const QString &) | Setter. |
QLayoutIterator QLayout::iterator() | Port to the new QLayout API. |
void QLayout::setAutoAdd(bool) | Setter. |
void QLayout::setMargin(int) | Setter. |
void QLayout::setMenuBar(QMenuBar *) | Setter. |
void QLayout::setSpacing(int) | Setter. |
QLayoutIterator QLayoutItem::iterator() | Port to the new QLayoutItem API. |
void QLayoutItem::setAlignment(int) | Setter. |
bool QLibrary::unload() | Never used polymorphically in Qt. |
void QLineEdit::clear() | Connect to QLineEdit::textChanged() instead. |
void QLineEdit::clearValidator() | Never used polymorphically in Qt. |
void QLineEdit::copy() const | Never used polymorphically in Qt. |
void QLineEdit::cut() | Never used polymorphically in Qt. |
void QLineEdit::deselect() | Connect to QLineEdit::selectionChanged() instead. |
void QLineEdit::insert(const QString &) | Connect to QLineEdit::textChanged() instead. |
void QLineEdit::paste() | Connect to QLineEdit::textChanged() instead. |
void QLineEdit::redo() | Never used polymorphically in Qt. |
void QLineEdit::selectAll() | Connect to QLineEdit::selectionChanged() instead. |
void QLineEdit::setAlignment(int) | Setter. |
void QLineEdit::setCursorPosition(int) | Connect to QLineEdit::cursorPositionChanged() instead. |
void QLineEdit::setDragEnabled(bool) | Setter. |
void QLineEdit::setEchoMode(EchoMode) | Setter. |
void QLineEdit::setFrame(bool) | Setter. |
void QLineEdit::setMaxLength(int) | Setter. |
void QLineEdit::setReadOnly(bool) | Setter. |
void QLineEdit::setSelection(int, int) | Connect to QLineEdit::selectionChanged() instead. |
void QLineEdit::setText(const QString &) | Connect to QLineEdit::textChanged() instead. |
void QLineEdit::setValidator(const QValidator *) | Setter. |
void QLineEdit::undo() | Never used in a polymorphic way by Qt. |
void QMainWindow::addDockWindow(QDockWindow *, Dock, bool) | Port to the new QMainWindow API. |
void QMainWindow::addDockWindow(QDockWindow *, const QString &, Dock, bool) | Port to the new QMainWindow API. |
void QMainWindow::customize() | Port to the new QMainWindow API. |
bool QMainWindow::isCustomizable() const | Port to the new QMainWindow API. |
void QMainWindow::moveDockWindow(QDockWindow *, Dock) | Port to the new QMainWindow API. |
void QMainWindow::moveDockWindow(QDockWindow *, Dock, bool, int, int) | Port to the new QMainWindow API. |
void QMainWindow::removeDockWindow(QDockWindow *) | Port to the new QMainWindow API. |
void QMainWindow::setAppropriate(QDockWindow *, bool) | Port to the new QMainWindow API. |
void QMainWindow::setCentralWidget(QWidget *) | Setter. |
void QMainWindow::setDockEnabled(QDockWindow *, Dock, bool) | Port to the new QMainWindow API. |
void QMainWindow::setDockEnabled(Dock, bool) | Port to the new QMainWindow API. |
void QMainWindow::setDockMenuEnabled(bool) | Port to the new QMainWindow API. |
void QMainWindow::setDockWindowsMovable(bool) | Port to the new QMainWindow API. |
void QMainWindow::setOpaqueMoving(bool) | Port to the new QMainWindow API. |
void QMainWindow::setRightJustification(bool) | Port to the new QMainWindow API. |
void QMainWindow::setUpLayout() | Port to the new QMainWindow API. |
void QMainWindow::setUsesBigPixmaps(bool) | Port to the new QMainWindow API. |
void QMainWindow::setUsesTextLabel(bool) | Port to the new QMainWindow API. |
bool QMainWindow::showDockMenu(const QPoint &) | Port to the new QMainWindow API. |
void QMenuBar::activateItemAt(int) | Port to the new QMenuBar API. |
void QMenuBar::menuContentsChanged() | Port to the new QMenuBar API. |
void QMenuBar::menuDelPopup(QPopupMenu *) | Port to the new QMenuBar API. |
void QMenuBar::menuInsPopup(QPopupMenu *) | Port to the new QMenuBar API. |
void QMenuBar::menuStateChanged() | Port to the new QMenuBar API. |
void QMenuBar::setId(int, int) | Port to the new QMenuBar API. |
void QMenuBar::setSeparator(Separator) | Port to the new QMenuBar API. |
void QMenuBar::updateItem(int) | Port to the new QMenuBar API. |
QMutex::~QMutex() | Value type. |
bool QObject::checkConnectArgs(const char *, const QObject *, const char *) | Reimplementing this function is no longer possible. |
const char * QObject::className() const | Reimplementing this function is no longer supported. |
void QObject::insertChild(QObject *) | Reimplement QObject::childEvent() instead and handle QEvent::ChildAdded events. |
QVariant QObject::property(const char *) const | Reimplementing this function is no longer supported. |
void QObject::removeChild(QObject *) | Reimplement QObject::childEvent() instead and handle QEvent::ChildRemoved events. |
void QObject::setName(const char *) | Setter. |
bool QObject::setProperty(const char *, const QVariant &) | Setter. |
bool QPaintDevice::cmd(int , QPainter * , QPDevCmdParam *) | Port to the new QPaintEngine API. |
Qt::HANDLE QPaintDevice::handle() const | Port to the new QPaintDevice API. |
HDC QPaintDevice::handle() const | Port to the new QPaintDevice API. |
void QPopupMenu::activateItemAt(int) | Port to the new QMenu API. |
void QPopupMenu::menuContentsChanged() | Port to the new QMenu API. |
void QPopupMenu::menuDelPopup(QPopupMenu *) | Port to the new QMenu API. |
void QPopupMenu::menuInsPopup(QPopupMenu *) | Port to the new QMenu API. |
void QPopupMenu::menuStateChanged() | Port to the new QMenu API. |
void QPopupMenu::setActiveItem(int) | Port to the new QMenu API. |
void QPopupMenu::setCheckable(bool) | Port to the new QMenu API. |
void QPopupMenu::setId(int, int) | Port to the new QMenu API. |
void QPopupMenu::updateItem(int) | Port to the new QMenu API. |
int QPrinter::resolution() const | Call QPrinter::setResolution() to change the resolution. |
void QPrinter::setColorMode(ColorMode) | Subclass QPrintEngine instead. |
void QPrinter::setCreator(const QString &) | Subclass QPrintEngine instead. |
void QPrinter::setDocName(const QString &) | Subclass QPrintEngine instead. |
void QPrinter::setFromTo(int, int) | Subclass QPrintEngine instead. |
void QPrinter::setFullPage(bool) | Subclass QPrintEngine instead. |
void QPrinter::setMinMax(int, int) | Subclass QPrintEngine instead. |
void QPrinter::setNumCopies(int) | Subclass QPrintEngine instead. |
void QPrinter::setOrientation(Orientation) | Subclass QPrintEngine instead. |
void QPrinter::setOutputFileName(const QString &) | Subclass QPrintEngine instead. |
void QPrinter::setOutputToFile(bool) | Subclass QPrintEngine instead. |
void QPrinter::setPageOrder(PageOrder) | Subclass QPrintEngine instead. |
void QPrinter::setPageSize(PageSize) | Subclass QPrintEngine instead. |
void QPrinter::setPaperSource(PaperSource) | Subclass QPrintEngine instead. |
void QPrinter::setPrintProgram(const QString &) | Subclass QPrintEngine instead. |
void QPrinter::setPrinterName(const QString &) | Subclass QPrintEngine instead. |
void QPrinter::setPrinterSelectionOption(const QString &) | Subclass QPrintEngine instead. |
void QPrinter::setResolution(int) | Subclass QPrintEngine instead. |
void QProcess::addArgument(const QString &) | Not used polymorphically in Qt. |
void QProcess::closeStdin() | Not used polymorphically in Qt. |
bool QProcess::launch(const QByteArray & buf, QStringList *) | Not used polymorphically in Qt. |
bool QProcess::launch(const QString & buf, QStringList *) | Not used polymorphically in Qt. |
QString QProcess::readLineStderr() | Not used polymorphically in Qt. |
QString QProcess::readLineStdout() | Not used polymorphically in Qt. |
QByteArray QProcess::readStderr() | Not used polymorphically in Qt. |
QByteArray QProcess::readStdout() | Not used polymorphically in Qt. |
void QProcess::setArguments(const QStringList &) | Not used polymorphically in Qt. |
void QProcess::setWorkingDirectory(const QDir &) | Not used polymorphically in Qt. |
bool QProcess::start(QStringList *) | Not used polymorphically in Qt. |
void QProcess::writeToStdin(const QByteArray &) | Not used polymorphically in Qt. |
bool QProgressBar::setIndicator(QString &, int, int) | Not used polymorphically in Qt. |
void QProgressBar::setProgress(int) | Not used polymorphically in Qt. |
void QProgressBar::setTotalSteps(int) | Not used polymorphically in Qt. |
void QPushButton::setAutoDefault(bool) | Not used polymorphically in Qt. |
void QPushButton::setDefault(bool) | Not used polymorphically in Qt. |
void QPushButton::setIsMenuButton(bool) | Not used polymorphically in Qt. |
void QPushButton::setOn(bool) | Connect to QPushButton::toggled(bool) instead. |
void QRadioButton::setChecked(bool) | Connect to QRadioButton::toggled(bool) instead. |
uchar * QScreen::cache(int , int) | Port to the new QScreen API. |
void QScreen::set(unsigned int , unsigned int , unsigned int , unsigned) | Port to the new QScreen API. |
void QScreen::uncache(uchar *) | Port to the new QScreen API. |
void QScrollBar::setOrientation(Orientation) | Setter. |
void QScrollBar::setTracking(bool) | Setter. |
void QSignalMapper::setMapping(const QObject *, const QString &) | Setter. |
void QSignalMapper::setMapping(const QObject *, int) | Setter. |
void QSlider::rangeChange() | Reimplement QSlider::sliderChange() instead. |
void QSlider::setOrientation(Orientation) | Setter. |
void QSlider::setPalette(const QPalette &) | Setter. |
void QSlider::setTickInterval(int) | Setter. |
void QSlider::setTickmarks(TickSetting) | Setter. |
void QSlider::setTracking(bool) | Setter. |
void QSlider::setValue(int) | Reimplement QSlider::sliderChange() instead. |
void QSlider::valueChange() | Reimplement QSlider::sliderChange() instead. |
QString QSpinBox::cleanText() const | Port to the new QSpinBox API. |
void QSpinBox::interpretText() | Port to the new QSpinBox API. |
QString QSpinBox::prefix() const | Port to the new QSpinBox API. |
void QSpinBox::rangeChange() | Reimplement QSpinBox::sliderChange() instead. |
void QSpinBox::selectAll() | Port to the new QSpinBox API. |
void QSpinBox::setButtonSymbols(ButtonSymbols) | Setter. |
void QSpinBox::setPrefix(const QString &) | Setter. |
void QSpinBox::setSpecialValueText(const QString &) | Setter. |
void QSpinBox::setSuffix(const QString &) | Setter. |
void QSpinBox::setValidator(const QValidator *) | Setter. |
void QSpinBox::setValue(int) | Connect to QSpinBox::valueChanged(). |
void QSpinBox::setWrapping(bool) | Setter. |
void QSpinBox::stepDown() | Reimplement QSpinBox::stepBy() instead. |
void QSpinBox::stepUp() | Reimplement QSpinBox::stepBy() instead. |
QString QSpinBox::suffix() const | Port to the new QSpinBox API. |
void QSpinBox::updateDisplay() | Port to the new QSpinBox API. |
void QSpinBox::valueChange() | Reimplement QSpinBox::sliderChange() instead. |
void QSplitter::drawSplitter(QPainter *, QCOORD, QCOORD, QCOORD, QCOORD) | Reimplement QStyle::drawPrimitive() instead and handle QStyle::PE_Splitter. |
void QSplitter::setOpaqueResize(bool) | Setter. |
void QSplitter::setOrientation(Orientation) | Setter. |
void QSplitter::setResizeMode(QWidget *, ResizeMode) | Setter. |
void QSqlDatabase::setDatabaseName(const QString &) | Setter. |
void QSqlDatabase::setHostName(const QString &) | Setter. |
void QSqlDatabase::setPassword(const QString &) | Setter. |
void QSqlDatabase::setPort(int) | Setter. |
void QSqlDatabase::setUserName(const QString &) | Setter. |
QSqlQuery QSqlDriver::createQuery() const | Port to the new QSqlDriver API. |
QString QSqlDriver::nullText() const | Port to the new QSqlDriver API. |
QSqlRecord QSqlDriver::record(const QSqlQuery &) const | Port to the new QSqlDriver API. |
QSqlRecordInfo QSqlDriver::recordInfo(const QSqlQuery &) const | Port to the new QSqlDriver API. |
QSqlRecordInfo QSqlDriver::recordInfo(const QString &) const | Port to the new QSqlDriver API. |
void QSqlError::setDatabaseText(const QString &) | Value type. |
void QSqlError::setDriverText(const QString &) | Value type. |
void QSqlError::setNumber(int) | Value type. |
void QSqlError::setType(int) | Value type. |
QSqlError::~QSqlError() | Value type. |
void QSqlField::setName(const QString &) | Value type. |
void QSqlField::setNull() | Value type. |
void QSqlField::setReadOnly(bool) | Value type. |
void QSqlField::setValue(const QVariant &) | Value type. |
QVariant QSqlField::value() const | Value type. |
QSqlField::~QSqlField() | Value type. |
void QSqlFieldInfo::setCalculated(bool) | Value type. |
void QSqlFieldInfo::setGenerated(bool) | Value type. |
void QSqlFieldInfo::setTrim(bool) | Value type. |
QSqlFieldInfo::~QSqlFieldInfo() | Value type. |
void QSqlIndex::append(const QSqlField &) | Value type. |
void QSqlIndex::append(const QSqlField &, bool) | Value type. |
void QSqlIndex::setCursorName(const QString &) | Value type. |
void QSqlIndex::setDescending(int, bool) | Value type. |
void QSqlIndex::setName(const QString &) | Value type. |
QVariant QSqlQuery::value(int) const | Exists as a non-virtual function. |
void QSqlRecord::append(const QSqlField &) | Value type. |
void QSqlRecord::clear() | Value type. |
void QSqlRecord::clearValues(bool) | Value type. |
void QSqlRecord::insert(int, const QSqlField &) | Value type. |
void QSqlRecord::remove(int) | Value type. |
void QSqlRecord::setGenerated(const QString &, bool) | Value type. |
void QSqlRecord::setGenerated(int, bool) | Value type. |
void QSqlRecord::setNull(int) | Value type. |
void QSqlRecord::setNull(const QString &) | Value type. |
void QSqlRecord::setValue(const QString &, const QVariant &) | Value type. |
void QSqlRecord::setValue(int, const QVariant &) | Value type. |
QString QSqlRecord::toString(const QString &, const QString &) const | Value type. |
QStringList QSqlRecord::toStringList(const QString &) const | Value type. |
QVariant QSqlRecord::value(int) const | Value type. |
QVariant QSqlRecord::value(const QString &) const | Value type. |
QSqlRecord::~QSqlRecord() | Value type. |
void QStyle::polishPopupMenu(QPopupMenu *) | Reimplement QStyle::polish(QWidget *) instead. |
int QTabBar::addTab(QTab *) | Reimplement QTabBar::tabInserted() instead. |
int QTabBar::insertTab(QTab *, int) | Reimplement QTabBar::tabInserted() instead. |
void QTabBar::layoutTabs() | Reimplement QTabBar::tabLayoutChange() instead. |
void QTabBar::paint(QPainter *, QTab *, bool) const | Reimplement QTabBar::paintEvent() instead. |
void QTabBar::paintLabel(QPainter *, const QRect &, QTab *, bool) const | Reimplement QTabBar::paintEvent() instead. |
void QTabBar::removeTab(QTab *) | Reimplement QTabBar::tabRemoved() instead. |
QTab * QTabBar::selectTab(const QPoint &) const | Reimplement QTabBar::mousePressEvent() instead. |
void QTabBar::setCurrentTab(int) | Connect to the QTabBar::currentChanged() signal. |
void QTabBar::setCurrentTab(QTab *) | Connect to the QTabBar::currentChanged() signal. |
void QTabBar::setShape(Shape) | Setter. |
void QTabBar::setTabEnabled(int, bool) | Setter. |
void QTabWidget::addTab(QWidget *, const QString &) | Reimplement QTabWidget::tabInserted() instead. |
void QTabWidget::addTab(QWidget *, const QIcon &, const QString &) | Reimplement QTabWidget::tabInserted() instead. |
void QTabWidget::addTab(QWidget *, QTab *) | Reimplement QTabWidget::tabInserted() instead. |
void QTabWidget::insertTab(QWidget *, const QIcon &, const QString &, int) | Reimplement QTabWidget::tabInserted() instead. |
void QTabWidget::insertTab(QWidget *, const QString &, int) | Reimplement QTabWidget::tabInserted() instead. |
void QTabWidget::insertTab(QWidget *, QTab *, int) | Reimplement QTabWidget::tabInserted() instead. |
void QTabWidget::removePage(QWidget *) | Reimplement QTabWidget::tabRemoved() instead. |
void QTabWidget::showPage(QWidget *) | Connect to QTabWidget::currentChanged() instead. |
void QTextEdit::append(const QString &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::clear() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::clearParagraphBackground(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::copy() | Use Q3TextEdit or port to the new QTextEdit API. |
QPopupMenu * QTextEdit::createPopupMenu(const QPoint &) | Use Q3TextEdit or port to the new QTextEdit API. |
QPopupMenu * QTextEdit::createPopupMenu() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::cut() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::del() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::doKeyboardAction(KeyboardAction) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::ensureCursorVisible() | Use Q3TextEdit or port to the new QTextEdit API. |
bool QTextEdit::find(const QString &, bool, bool, bool, int *, int *) | Use Q3TextEdit or port to the new QTextEdit API. |
bool QTextEdit::focusNextPrevChild(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
int QTextEdit::heightForWidth(int) const | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::insert(const QString &, bool, bool, bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::insertAt(const QString &, int, int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::insertParagraph(const QString &, int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::moveCursor(CursorAction, bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::paste() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::pasteSubType(const QCString &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::placeCursor(const QPoint &, QTextCursor *) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::redo() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::removeParagraph(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::removeSelectedText(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::removeSelection(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::scrollToAnchor(const QString &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::scrollToBottom() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::selectAll(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setAlignment(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setBold(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setColor(const QColor &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setCurrentFont(const QFont &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setCursorPosition(int, int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setFamily(const QString &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setItalic(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setLinkUnderline(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setMimeSourceFactory(QMimeSourceFactory *) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setModified(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setOverwriteMode(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setPaper(const QBrush &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setParagraphBackgroundColor(int, const QColor &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setPointSize(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setReadOnly(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setSelection(int, int, int, int, int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setSelectionAttributes(int, const QColor &, bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setStyleSheet(QStyleSheet *) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setTabStopWidth(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setText(const QString &, const QString &) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setTextFormat(TextFormat) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setUnderline(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setUndoDepth(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setUndoRedoEnabled(bool) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setVerticalAlignment(VerticalAlignment) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setWordWrap(WordWrap) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setWrapColumnOrWidth(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::setWrapPolicy(WrapPolicy) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::sync() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::undo() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::zoomIn() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::zoomIn(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::zoomOut(int) | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::zoomOut() | Use Q3TextEdit or port to the new QTextEdit API. |
void QTextEdit::zoomTo(int) | Use Q3TextEdit or port to the new QTextEdit API. |
QString QTimeEdit::sectionFormattedText(int) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setAutoAdvance(bool) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setHour(int) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setMaxValue(const QTime &) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setMinValue(const QTime &) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setMinute(int) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setRange(const QTime &, const QTime &) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setSecond(int) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setSeparator(const QString &) | Port to the new QDateTimeEdit API. |
void QTimeEdit::setTime(const QTime &) | Port to the new QDateTimeEdit API. |
void QToolBar::clear() | Setter. |
void QToolBar::setLabel(const QString &) | Setter. |
void QToolBar::setStretchableWidget(QWidget *) | Setter. |
void QToolButton::setIconSet(const QIcon &) | Setter. |
void QToolButton::setOn(bool) | Connect to QToolButton::toggled(bool) instead. |
void QToolButton::setTextLabel(const QString &, bool) | Setter. |
void QToolButton::setToggleButton(bool) | Setter. |
void QToolButton::setUsesBigPixmap(bool) | Setter. |
void QToolButton::setUsesTextLabel(bool) | Setter. |
void QToolTip::maybeTip(const QPoint &) | Port to the new QToolTip API. |
void QUrl::addPath(const QString &) | Value type. |
bool QUrl::cdUp() | Value type. |
bool QUrl::parse(const QString &) | Value type. |
void QUrl::reset() | Value type. |
void QUrl::setEncodedPathAndQuery(const QString &) | Value type. |
void QUrl::setFileName(const QString &) | Value type. |
void QUrl::setHost(const QString &) | Value type. |
void QUrl::setPassword(const QString &) | Value type. |
void QUrl::setPath(const QString &) | Value type. |
void QUrl::setPort(int) | Value type. |
void QUrl::setProtocol(const QString &) | Value type. |
void QUrl::setQuery(const QString &) | Value type. |
void QUrl::setRef(const QString &) | Value type. |
void QUrl::setUser(const QString &) | Value type. |
QString QUrl::toString(bool, bool) const | Value type. |
QUrl::~QUrl() | Value type. |
QWaitCondition::~QWaitCondition() | Value type. |
bool QWhatsThis::clicked(const QString &) | Port to the new QWhatsThis API. |
QString QWhatsThis::text(const QPoint &) | Port to the new QWhatsThis API. |
QWhatsThis::~QWhatsThis() | Port to the new QSpinBox API. |
void QWidget::adjustSize() | Reimplement QWidget::sizeHint() instead. |
bool QWidget::close(bool) | Reimplement QWidget::closeEvent(). |
void QWidget::create(WId, bool, bool) | Not supported in Qt 4. |
bool QWidget::customWhatsThis() const | Not supported in Qt 4. |
void QWidget::destroy(bool, bool) | Not supported in Qt 4. |
void QWidget::enabledChange(bool) | Reimplement QWidget::changeEvent() and handle QEvent::EnabledChange. |
void QWidget::fontChange(const QFont &) | Reimplement QWidget::changeEvent() and handle QEvent::FontChange. |
void QWidget::imComposeEvent(QIMEvent *) | Reimplement QWidget::inputMethodEvent() instead. |
void QWidget::imEndEvent(QIMEvent *) | Reimplement QWidget::inputMethodEvent() instead. |
void QWidget::imStartEvent(QIMEvent *) | Reimplement QWidget::inputMethodEvent() instead. |
void QWidget::move(int, int) | Setter. |
void QWidget::paletteChange(const QPalette &) | Reimplement QWidget::changeEvent() and handle QEvent::PaletteChange and/or QEvent::ApplicationPaletteChange. |
void QWidget::polish() | Reimplement event() and handle the QEvent::Polish event type. |
void QWidget::reparent(QWidget *, WFlags, const QPoint &, bool) | Reimplement QWidget::event() and handle QEvent::Reparent. |
void QWidget::resize(int, int) | Reimplement QWidget::resizeEvent() instead. |
void QWidget::setAcceptDrops(bool) | Setter. |
void QWidget::setActiveWindow() | Reimplement QWidget::changeEvent() and handle QEvent::ActivationChange. |
void QWidget::setAutoMask(bool) | Setter. |
void QWidget::setBackgroundColor(const QColor &) | Setter. |
void QWidget::setBackgroundMode(BackgroundMode) | Setter. |
void QWidget::setBackgroundOrigin(BackgroundOrigin) | Setter. |
void QWidget::setBackgroundPixmap(const QPixmap &) | Setter. |
void QWidget::setCaption(const QString &) | Reimplement QWidget::changeEvent() and handle QEvent::WindowTitleChange. |
void QWidget::setCursor(const QCursor &) | Setter. |
void QWidget::setEnabled(bool) | Reimplement QWidget::changeEvent() and handle QEvent::EnabledChange. |
void QWidget::setEraseColor(const QColor &) | Setter. |
void QWidget::setErasePixmap(const QPixmap &) | Setter. |
void QWidget::setFocus() | Reimplement QWidget::focusInEvent() or QWidget::focusOutEvent(). |
void QWidget::setFocusPolicy(FocusPolicy) | Setter. |
void QWidget::setFocusProxy(QWidget *) | Setter. |
void QWidget::setFont(const QFont &) | Reimplement QWidget::changeEvent() and handle QEvent::FontChange and/or QEvent::ApplicationFontChange. |
void QWidget::setGeometry(int, int, int, int) | Setter. |
void QWidget::setGeometry(const QRect &) | Setter. |
void QWidget::setIcon(const QPixmap &) | Reimplement QWidget::changeEvent() and handle QEvent::WindowIconChange. |
void QWidget::setIconText(const QString &) | Reimplement QWidget::changeEvent() and handle QEvent::IconTextChange. |
void QWidget::setKeyCompression(bool) | Setter. |
void QWidget::setMask(const QRegion &) | Setter. |
void QWidget::setMask(const QBitmap &) | Setter. |
void QWidget::setMaximumSize(int, int) | Setter. |
void QWidget::setMicroFocusHint(int, int, int, int, bool, QFont *) | Setter. |
void QWidget::setMinimumSize(int, int) | Setter. |
void QWidget::setMouseTracking(bool) | Reimplement QWidget::changeEvent() and handle QEvent::MouseTrackingChange. |
void QWidget::setPalette(const QPalette &) | Reimplement QWidget::changeEvent() and handle QEvent::PaletteChange and/or QEvent::ApplicationPaletteChange. |
void QWidget::setPaletteBackgroundColor(const QColor &) | Setter. |
void QWidget::setPaletteBackgroundPixmap(const QPixmap &) | Setter. |
void QWidget::setSizeIncrement(int, int) | Setter. |
void QWidget::setSizePolicy(QSizePolicy) | Setter. |
void QWidget::setUpdatesEnabled(bool) | Setter. |
void QWidget::setWFlags(WFlags) | Setter. |
void QWidget::show() | Reimplement QWidget::showEvent(). |
void QWidget::showMaximized() | Reimplement QWidget::changeEvent() and handle QEvent::WindowStateChange. |
void QWidget::showMinimized() | Reimplement QWidget::changeEvent() and handle QEvent::WindowStateChange. |
void QWidget::showNormal() | Reimplement QWidget::changeEvent() and handle QEvent::WindowStateChange. |
void QWidget::styleChange(QStyle &) | Reimplement QWidget::changeEvent() and handle QEvent::StyleChange. |
void QWidget::unsetCursor() | Setter. |
void QWidget::windowActivationChange(bool) | Reimplement QWidget::changeEvent() and handle QEvent::ActivationChange. |
Copyright © 2008 Trolltech | Trademarks | Qt 4.3.5 |