Qt 5.12 中的新类和函数

This page contains a comprehensive list of all new classes and functions introduced in Qt 5.12. Links to new APIs in previous Qt 5 releases are found at the bottom of this page.

新类

C
QCborArray
ConstIterator ( QCborArray )
QCborError
QCborMap
ConstIterator ( QCborMap )
QCborParserError
QCborStreamReader
QCborStreamWriter
QCborValue
D
QDtls
QDtlsClientVerifier
G
GeneratorParameters ( QDtlsClientVerifier )
QGeoRouteLeg
I
Iterator ( QCborArray )
Iterator ( QCborMap )
S
QScopeGuard
W
QWaylandXdgDecorationManagerV1
QWaylandXdgPopup
QWaylandXdgShell
QWaylandXdgSurface
QWaylandXdgToplevel
QWebEngineUrlScheme

新成员函数

QBluetoothDeviceInfo :

manufacturerData (quint16 manufacturerId ) const
manufacturerData () const
manufacturerIds () const
setManufacturerData (quint16 manufacturerId , const QByteArray & data )

QByteArray :

compare (const QByteArray & a , Qt::CaseSensitivity cs ) const
compare (const char * c , Qt::CaseSensitivity cs ) const
isLower () const
isUpper () const

QCryptographicHash :

hashLength (QCryptographicHash::Algorithm method )

QExplicitlySharedDataPointer :

take ()

QMetaEnum :

enumName () const

QRegularExpression :

anchoredPattern (const QString & 表达式 )
wildcardToRegularExpression (const QString & pattern )

QSortFilterProxyModel :

setFilterRegularExpression (const QString & pattern )

QString :

compare (QStringView s , Qt::CaseSensitivity cs ) const
isLower () const
isUpper () const

QStringList :

contains (QStringView str , Qt::CaseSensitivity cs ) const

QStringView :

compare (QStringView other , Qt::CaseSensitivity cs ) const

QTextStream :

operator<< (QStringView string )

QTimer :

callOnTimeout (Functor slot , Qt::ConnectionType connectionType )
callOnTimeout (const QObject * context , Functor slot , Qt::ConnectionType connectionType )
callOnTimeout (const QObject * receiver , PointerToMemberFunction slot , Qt::ConnectionType connectionType )

QMetaEnumBuilder :

enumName () const
setEnumName (const QByteArray & alias )

QDBusMessage :

isInteractiveAuthorizationAllowed () const
setInteractiveAuthorizationAllowed (bool enable )

QBitmap :

fromImage (QImage && image , Qt::ImageConversionFlags flags )

QIcon :

fallbackThemeName ()
setFallbackThemeName (const QString & name )

QImageReader :

imageFormatsForMimeType (const QByteArray & mimeType )

QImageWriter :

imageFormatsForMimeType (const QByteArray & mimeType )

QPainter :

fillRect (const QRect & rectangle , QGradient::Preset preset )
fillRect (const QRectF & rectangle , QGradient::Preset preset )
fillRect (int x , int y , int width , int height , QGradient::Preset preset )

QPalette :

placeholderText () const

QStandardItemModel :

clearItemData (const QModelIndex & index )

QStandardItem :

clearData ()

QTextBlockFormat :

headingLevel () const
setHeadingLevel (int level )

QTextImageFormat :

quality () const
setQuality (int quality )

QGeoRoute :

routeLegs () const
setRouteLegs (const QList<QGeoRouteLeg> & legs )

QGeoRouteSegment :

isLegLastSegment () const

QGeoServiceProviderFactoryV3 :

virtual setQmlEngine (QQmlEngine * engine )

QSslCertificate :

issuerDisplayName () const
subjectDisplayName () const

QNearFieldManager :

adapterStateChanged (QNearFieldManager::AdapterState state )
isSupported () const

QNearFieldTarget :

reportError (QNearFieldTarget::Error error , const QNearFieldTarget::RequestId & id )

QGeoPath :

clearPath ()

QGeoPolygon :

addHole (const QList<QGeoCoordinate> & holePath )
addHole (const QVariant & holePath )
hole (int index ) const
holePath (int index ) const
holesCount () const
removeHole (int index )

QJSEngine :

importModule (const QString & fileName )
newErrorObject (QJSValue::ErrorType errorType , const QString & message )

QJSValue :

errorType () const

QQmlComponent :

engine () const

QQmlEngine :

singletonInstance (int qmlTypeId )

QQuickStyle :

addStylePath (const QString & path )
stylePathList ()

QCanBusDevice :

clear (QCanBusDevice::Directions direction )
readAllFrames ()

QWebSocket :

bytesToWrite () const

QWebSocketServer :

nativeDescriptor () const
setNativeDescriptor (qintptr socketDescriptor )

QDoubleSpinBox :

setStepType (QAbstractSpinBox::StepType stepType )

QLayout :

indexOf (QLayoutItem * layoutItem ) const

QLineEdit :

inputRejected ()

QSpinBox :

setStepType (QAbstractSpinBox::StepType stepType )

QWaylandCompositor :

addSocketDescriptor (int fd )

QWaylandSeat :

sendKeyEvent (int qtKey , bool pressed )

QRemoteObjectHostBase :

addHostSideConnection (QIODevice * ioDevice )

QRemoteObjectNode :

addClientSideConnection (QIODevice * ioDevice )
registerExternalSchema (const QString & schema , QRemoteObjectNode::RemoteObjectSchemaHandler handler )

名称空间中的新函数

deriveKeyPbkdf1 (QCryptographicHash::Algorithm algorithm , const QByteArray & data , const QByteArray & salt , int iterations , quint64 dkLen )
deriveKeyPbkdf2 (QCryptographicHash::Algorithm algorithm , const QByteArray & data , const QByteArray & salt , int iterations , quint64 dkLen )
imageFromHBITMAP (HBITMAP bitmap , QtWin::HBitmapFormat format )
imageToHBITMAP (const QImage & image , QtWin::HBitmapFormat format )
toString (const std::tuple<Types...> & tuple )
toString (const QCborError & c )

新全局函数

qFromBigEndian (const void * src , qsizetype count , void * dest )
qFromLittleEndian (const void * src , qsizetype count , void * dest )
qToBigEndian (const void * src , qsizetype count , void * dest )
qToLittleEndian (const void * src , qsizetype count , void * dest )
qmlTypeId (const char * uri , int versionMajor , int versionMinor , const char * qmlName )

新宏

QT_TRANSLATE_N_NOOP ( context , sourceText )
QT_TRANSLATE_N_NOOP3 ( context , sourceText , comment )
QT_TR_N_NOOP ( sourceText )

新枚举类型

enum Field { None, RSSI, ManufacturerData, All }
enum Direction { Input, Output, AllDirections }
enum HandshakeState { HandshakeNotStarted, HandshakeInProgress, PeerVerificationFailed, HandshakeComplete }
enum QDtlsError { NoError, InvalidInputParameters, InvalidOperation, UnderlyingSocketError, ..., TlsNonFatalError }
enum Preset { WarmFlame, NightFade, SpringWarmth, JuicyPeach, ..., PerfectBlue }
enum ErrorType { NoError, GenericError, EvalError, RangeError, ..., URIError }
enum AdapterState { Offline, TurningOn, Online, TurningOff }

新的 Typedef

typedef RemoteObjectSchemaHandler

新特性

新 QML 类型

W
WavefrontMesh
X
XdgDecorationManagerV1
XdgPopup
XdgShell
XdgSurface
XdgToplevel

新 QML 特性

defaultLogLevel
orientation
sortCaseSensitive
synchronousDrag
visibleArea

新 QML 信号

finished ()
finished ()

新 QML 方法

coordToMercator ()
mercatorToCoord ()
polygon ()
等于 ()
addSocketDescriptor ()
sendKeyEvent ()
action ()

其它 Qt 5 发行的补充