Qt 4.8 provides many improvements and enhancements over the previous releases in the Qt 4 series. This document covers the most important features in this release, separated by category.
A list of other Qt 4 features can be found on the Qt 4 的新功能 页面。
Qt Quick 1.1 引入 新变化 such as new properties and better performance.
QPA allows porting Qt to different windowing systems and devices easier. It provides a clean abstraction layer for porting QtGui to new window systems.
注意: QPA is considered an experimental feature in Qt 4.8. In Qt 5 it is a supported and complete feature.
新的 Qt WebKit release introduces bug fixes, performance improvements, and greater compiler compatibility.
Many Qt OpenGL functions are now thread-safe. Threads that cater to different situations are now available.
As part of Open Governance, modules in Qt 4.8 will receive maintainers and receive different support levels.
Currently, a module has an activity classification, the Module Maturity Level . As well, a list of modules and their maturity level is in the Qt 开发者网络 .
Qt 4.8 引入对 Qt API 的更改。
Changes to the Localization APIs include improvements to QLocale and more support for different language code formats.
类 QGraphicsWebView :
| QPainter::RenderHints | renderHints () const |
| void | setRenderHint (QPainter::RenderHint hint , bool enabled = true) |
| void | setRenderHints (QPainter::RenderHints hints ) |
类 QWebPage :
| void | viewportChangeRequested () |
类 QThreadPool :
| bool | waitForDone (int msecs ) |
| void | insert (const QProcessEnvironment & e ) |
| QStringList | keys () const |
类 QUrl :
| bool | isLocalFile () const |
| void | swap (QUrl & other ) |
| QString | topLevelDomain () const |
| void | resetInternalData () |
类 QObject :
| bool | connect (const QObject * sender , const QMetaMethod & signal , const QObject * receiver , const QMetaMethod & method , Qt::ConnectionType type = Qt::AutoConnection) |
| bool | disconnect (const QObject * sender , const QMetaMethod & signal , const QObject * receiver , const QMetaMethod & method ) |
| int | senderSignalIndex () const |
类 QSharedMemory :
| QString | nativeKey () const |
| void | setNativeKey (const QString & key ) |
类 QTranslator :
| bool | load (const QLocale & locale , const QString & filename , const QString & prefix = QString(), const QString & directory = QString(), const QString & suffix = QString()) |
类 QVariant :
| void | swap (QVariant & other ) |
类 QUuid :
| QUuid | fromRfc4122 (const QByteArray & bytes ) |
| QByteArray | toByteArray () const |
| QByteArray | toRfc4122 () const |
类 QBitArray :
| void | swap (QBitArray & other ) |
类 QByteArray :
| void | swap (QByteArray & other ) |
类 QContiguousCache :
| void | swap (QContiguousCache<T> & other ) |
类 QChar :
| UnicodeVersion | currentUnicodeVersion () |
类 QElapsedTimer :
| qint64 | nsecsElapsed () const |
类 QHash :
| void | swap (QHash<Key, T> & other ) |
类 QMultiHash :
| void | swap (QMultiHash<Key, T> & other ) |
类 QLinkedList :
| void | swap (QLinkedList<T> & other ) |
类 QList :
| void | swap (QList<T> & other ) |
类 QLocale :
| QString | bcp47Name () const |
| QString | createSeparatedList (const QStringList & list ) const |
| QString | currencySymbol (CurrencySymbolFormat format = CurrencySymbol) const |
| Qt::DayOfWeek | firstDayOfWeek () const |
| QList<QLocale> | matchingLocales (QLocale::Language 语言 , QLocale::Script script , QLocale::Country country ) |
| QString | nativeCountryName () const |
| QString | nativeLanguageName () const |
| QString | quoteString (const QString & str , QuotationStyle style = StandardQuotation) const |
| QString | quoteString (const QStringRef & str , QuotationStyle style = StandardQuotation) const |
| Script | script () const |
| QString | scriptToString (Script script ) |
| QString | toCurrencyString (qlonglong value , const QString & symbol = QString()) const |
| QString | toCurrencyString (qulonglong value , const QString & symbol = QString()) const |
| QString | toCurrencyString (short value , const QString & symbol = QString()) const |
| QString | toCurrencyString (ushort value , const QString & symbol = QString()) const |
| QString | toCurrencyString (int value , const QString & symbol = QString()) const |
| QString | toCurrencyString (uint value , const QString & symbol = QString()) const |
| QString | toCurrencyString (double value , const QString & symbol = QString()) const |
| QString | toCurrencyString (float value , const QString & symbol = QString()) const |
| QString | toLower (const QString & str ) const |
| QString | toUpper (const QString & str ) const |
| QStringList | uiLanguages () const |
| QList<Qt::DayOfWeek> | weekdays () const |
类 QMap :
| void | swap (QMap<Key, T> & other ) |
类 QQueue :
| void | swap (QQueue<T> & other ) |
类 QPoint :
| QPoint & | operator*= (float factor ) |
| QPoint & | operator*= (double factor ) |
| QPoint & | operator*= (int factor ) |
类 QMultiMap :
| void | swap (QMultiMap<Key, T> & other ) |
类 QRegExp :
| void | swap (QRegExp & other ) |
类 QSet :
| void | swap (QSet<T> & other ) |
类 QString :
| bool | contains (const QStringRef & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | count (const QStringRef & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | endsWith (const QStringRef & s , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | indexOf (const QStringRef & str , int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | lastIndexOf (const QStringRef & str , int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | startsWith (const QStringRef & s , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| void | swap (QString & other ) |
类 QStack :
| void | swap (QStack<T> & other ) |
类 QStringRef :
| bool | contains (const QString & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | contains (QChar ch , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | contains (const QStringRef & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | count (const QString & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | count (QChar ch , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | count (const QStringRef & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | endsWith (const QString & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | endsWith (QLatin1String str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | endsWith (QChar ch , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | endsWith (const QStringRef & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | indexOf (const QString & str , int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | indexOf (QChar ch , int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | indexOf (QLatin1String str , int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | indexOf (const QStringRef & str , int from = 0, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | lastIndexOf (const QString & str , int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | lastIndexOf (QChar ch , int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | lastIndexOf (QLatin1String str , int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| int | lastIndexOf (const QStringRef & str , int from = -1, Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | startsWith (const QString & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | startsWith (QLatin1String str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | startsWith (QChar ch , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| bool | startsWith (const QStringRef & str , Qt::CaseSensitivity cs = Qt::CaseSensitive) const |
| QByteArray | toAscii () const |
| QByteArray | toLatin1 () const |
| QByteArray | toLocal8Bit () const |
| QVector<uint> | toUcs4 () const |
| QByteArray | toUtf8 () const |
类 QVarLengthArray :
| iterator | begin () |
| const_iterator | begin () const |
| const_iterator | constBegin () const |
| const_iterator | constEnd () const |
| iterator | end () |
| const_iterator | end () const |
| iterator | erase (iterator begin , iterator end ) |
| iterator | erase (iterator pos ) |
| void | insert (int i , const T & value ) |
| void | insert (int i , int count , const T & value ) |
| iterator | insert (iterator before , int count , const T & value ) |
| iterator | insert (iterator before , const T & value ) |
| QVarLengthArray<T, Prealloc> & | operator+= (const T & value ) |
| QVarLengthArray<T, Prealloc> & | operator<< (const T & value ) |
| void | prepend (const T & value ) |
| void | remove (int i ) |
| void | remove (int i , int count ) |
| void | replace (int i , const T & value ) |
类 QVector :
| void | swap (QVector<T> & other ) |
类 QXmlStreamWriter :
| bool | hasError () const |
| void | setTimeout (int timeout ) |
| int | timeout () const |
类 QDBusConnection :
| QDBusConnection | connectToPeer (const QString & address , const QString & name ) |
| ConnectionCapabilities | connectionCapabilities () const |
| void | disconnectFromPeer (const QString & name ) |
| QByteArray | localMachineId () |
| void | removeItem (QGraphicsLayoutItem * item ) |
类 QGraphicsLayout :
| bool | instantInvalidatePropagation () |
| void | setInstantInvalidatePropagation (bool enable ) |
类 QBitmap :
| void | swap (QBitmap & other ) |
类 QIcon :
| void | swap (QIcon & other ) |
类 QImage :
| void | fill (const QColor & color ) |
| void | fill (Qt::GlobalColor color ) |
| void | swap (QImage & other ) |
类 QPicture :
| void | swap (QPicture & other ) |
类 QPixmap :
| void | swap (QPixmap & other ) |
| virtual QModelIndex | buddy (const QModelIndex & index ) const |
| virtual bool | canFetchMore (const QModelIndex & parent ) const |
| virtual void | fetchMore (const QModelIndex & parent ) |
| virtual bool | hasChildren (const QModelIndex & parent = QModelIndex()) const |
| virtual QMimeData * | mimeData (const QModelIndexList & indexes ) const |
| virtual QStringList | mimeTypes () const |
| virtual void | sort (int column , Qt::SortOrder order = Qt::AscendingOrder) |
| virtual QSize | span (const QModelIndex & index ) const |
| virtual Qt::DropActions | supportedDropActions () const |
类 QApplication :
| Qt::KeyboardModifiers | queryKeyboardModifiers () |
类 QFileOpenEvent :
| bool | openFile (QFile & file , QIODevice::OpenMode flags ) const |
类 QKeySequence :
| void | swap (QKeySequence & other ) |
类 QSizePolicy :
| bool | hasWidthForHeight () const |
| void | setWidthForHeight (bool dependent ) |
类 QWidget :
(preliminary)
QPlatformWindow *
|
platformWindow () const |
| QPlatformWindowFormat | platformWindowFormat () const |
(preliminary)
void
|
setPlatformWindow (QPlatformWindow * window ) |
| void | setPlatformWindowFormat (const QPlatformWindowFormat & format ) |
类 QBrush :
| void | swap (QBrush & other ) |
类 QRadialGradient :
| qreal | centerRadius () const |
| qreal | focalRadius () const |
| void | setCenterRadius (qreal radius ) |
| void | setFocalRadius (qreal radius ) |
类 QPainter :
| QRectF | clipBoundingRect () const |
| void | drawGlyphRun (const QPointF & position , const QGlyphRun & glyphs ) |
| void | drawPixmapFragments (const QRectF * targetRects , const QRectF * sourceRects , int fragmentCount , const QPixmap & pixmap , PixmapFragmentHints hints = 0) |
类 QPainterPath :
| void | swap (QPainterPath & other ) |
类 QPolygon :
| void | swap (QPolygon & other ) |
类 QPen :
| void | swap (QPen & other ) |
类 QPolygonF :
| void | swap (QPolygonF & other ) |
类 QPrinterInfo :
| QPrinterInfo & | operator= (const QPrinterInfo & other ) |
类 QRegion :
| void | swap (QRegion & other ) |
类 QFont :
| HintingPreference | hintingPreference () const |
| void | setHintingPreference (HintingPreference hintingPreference ) |
| void | setStyleName (const QString & styleName ) |
| QString | styleName () const |
类 QFontMetrics :
| bool | inFontUcs4 (uint character ) const |
类 QFontInfo :
| QString | styleName () const |
类 QFontMetricsF :
| bool | inFontUcs4 (uint ch ) const |
类 QTextDocument :
| Qt::CursorMoveStyle | defaultCursorMoveStyle () const |
| void | setDefaultCursorMoveStyle (Qt::CursorMoveStyle style ) |
类 QTextCharFormat :
| QFont::HintingPreference | fontHintingPreference () const |
| void | setFontHintingPreference (QFont::HintingPreference hintingPreference ) |
类 QTextBlockFormat :
| qreal | lineHeight (qreal scriptLineHeight , qreal scaling ) const |
| qreal | lineHeight () const |
| int | lineHeightType () const |
| void | setLineHeight (qreal height , int heightType ) |
类 QTextListFormat :
| QString | numberPrefix () const |
| QString | numberSuffix () const |
| void | setNumberPrefix (const QString & numberPrefix ) |
| void | setNumberSuffix (const QString & numberSuffix ) |
类 QTextLayout :
| Qt::CursorMoveStyle | cursorMoveStyle () const |
| QList<QGlyphRun> | glyphRuns () const |
| int | leftCursorPosition (int oldPos ) const |
| int | rightCursorPosition (int oldPos ) const |
| void | setCursorMoveStyle (Qt::CursorMoveStyle style ) |
类 QUndoCommand :
| QString | actionText () const |
类 QCheckBox :
| virtual QSize | minimumSizeHint () const |
类 QLineEdit :
| Qt::CursorMoveStyle | cursorMoveStyle () const |
| void | setCursorMoveStyle (Qt::CursorMoveStyle style ) |
类 QRadioButton :
| virtual QSize | minimumSizeHint () const |
类 QTabWidget :
| virtual int | heightForWidth (int width ) const |
| QNetworkReply * | post (const QNetworkRequest & request , QHttpMultiPart * multiPart ) |
| QNetworkReply * | put (const QNetworkRequest & request , QHttpMultiPart * multiPart ) |
类 QNetworkReply :
| void | setFinished (bool finished ) |
类 QNetworkConfigurationManager :
| void | configurationRemoved (const QNetworkConfiguration & config ) |
| void | setNetworkConfiguration (const QNetworkConfiguration & networkConfiguration ) |
| virtual bool | joinMulticastGroup (const QHostAddress & groupAddress , const QNetworkInterface & iface ) |
| virtual bool | leaveMulticastGroup (const QHostAddress & groupAddress , const QNetworkInterface & iface ) |
| virtual QNetworkInterface | multicastInterface () const |
| virtual bool | setMulticastInterface (const QNetworkInterface & iface ) |
类 QUdpSocket :
| bool | joinMulticastGroup (const QHostAddress & groupAddress ) |
| bool | joinMulticastGroup (const QHostAddress & groupAddress , const QNetworkInterface & iface ) |
| bool | leaveMulticastGroup (const QHostAddress & groupAddress ) |
| bool | leaveMulticastGroup (const QHostAddress & groupAddress , const QNetworkInterface & iface ) |
| QNetworkInterface | multicastInterface () const |
| void | setMulticastInterface (const QNetworkInterface & iface ) |
| bool | testSslOption (QSsl::SslOption option ) const |
类 QSslSocket :
| QString | peerVerifyName () const |
| void | setPeerVerifyName (const QString & hostName ) |
类 QGLFormat :
| QGLFormat | fromPlatformWindowFormat (const QPlatformWindowFormat & format ) |
| QPlatformWindowFormat | toPlatformWindowFormat (const QGLFormat & format ) |
类 QGLContext :
| QGLContext * | fromPlatformGLContext (QPlatformGLContext * platformContext ) |
类 QGLFramebufferObjectFormat :
| bool | mipmap () const |
| void | setMipmap (bool enabled ) |
| void | setJoinMode (QSqlRelationalTableModel::JoinMode joinMode ) |
| void | collapseExtendedSearch () |
| void | expandExtendedSearch () |
| void | setQuery (const QList<QHelpSearchQuery> & queryList ) |
| bool | operator!= (const QPlatformWindowFormat & a , const QPlatformWindowFormat & b ) |
| bool | operator!= (const QVarLengthArray<T, Prealloc1> & left , const QVarLengthArray<T, Prealloc2> & right ) |
| const QPoint | operator* (int factor , const QPoint & point ) |
| const QPoint | operator* (double factor , const QPoint & point ) |
| const QPoint | operator* (float factor , const QPoint & point ) |
| const QPoint | operator* (const QPoint & point , int factor ) |
| const QPoint | operator* (const QPoint & point , double factor ) |
| const QPoint | operator* (const QPoint & point , float factor ) |
| bool | operator== (const QPlatformWindowFormat & a , const QPlatformWindowFormat & b ) |
| bool | operator== (const QVarLengthArray<T, Prealloc1> & left , const QVarLengthArray<T, Prealloc2> & right ) |
| Q_LIKELY ( expr ) | |
| Q_UNLIKELY ( expr ) |
| enum | ConnectionCapability { UnixFileDescriptorPassing } |
| enum | FileHandleFlag { AutoCloseHandle, DontCloseHandle } |
| enum | HintingPreference { PreferDefaultHinting, PreferNoHinting, PreferVerticalHinting, PreferFullHinting } |
| enum | CurrencySymbolFormat { CurrencyIsoCode, CurrencySymbol, CurrencyDisplayName } |
| enum | QuotationStyle { StandardQuotation, AlternateQuotation } |
| enum | Script { AnyScript, ArabicScript, CyrillicScript, DeseretScript, ..., TifinaghScript } |
| enum | JoinMode { InnerJoin, LeftJoin } |
| enum | LineHeightTypes { SingleHeight, ProportionalHeight, FixedHeight, MinimumHeight, LineDistanceHeight } |
| enum | CursorMoveStyle { LogicalMoveStyle, VisualMoveStyle } |
| typedef | const_reference |
| typedef | reference |
| typedef | value_type |
|
|