Qt 5.10 中的新类和函数

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

新类

A
QAndroidBinder
QAndroidIntent
QAndroidJniExceptionCleaner
QAndroidParcel
QAndroidService
QAndroidServiceConnection
QAbstractSkeleton ( Qt3DCore )
QArmature ( Qt3DCore )
QAbstractCameraController ( Qt3DExtras )
B
QBEInteger
QBlitFramebuffer ( Qt3DRender )
D
QDiffuseSpecularMaterial ( Qt3DExtras )
G
QGeoPolygon
J
QJoint ( Qt3DCore )
K
QKeyValueIterator
L
QLEInteger
QLineWidth ( Qt3DRender )
N
QNodeCommand ( Qt3DCore )
P
QPickLineEvent ( Qt3DRender )
QPickPointEvent ( Qt3DRender )
QProximityFilter ( Qt3DRender )
R
QRandomGenerator
QRandomGenerator64
S
QSemaphoreReleaser
QStringView
QSkeleton ( Qt3DCore )
QSkeletonLoader ( Qt3DCore )
QShaderProgramBuilder ( Qt3DRender )
V
QVulkanDeviceFunctions
QVulkanFunctions
QVulkanInstance
QVulkanWindow
QVulkanWindowRenderer
W
QWaylandXdgPopupV6
QWaylandXdgShellV6
QWaylandXdgSurfaceV6
QWaylandXdgToplevelV6

新成员函数

QAbstractFileEngine :

virtual cloneTo (QAbstractFileEngine * target )
virtual setFileTime (const QDateTime & newDate , QAbstractFileEngine::FileTime time )

QDebug :

operator<< (QStringView s )

QFileDevice :

fileTime (QFileDevice::FileTime time ) const
setFileTime (const QDateTime & newDate , QFileDevice::FileTime fileTime )

QFileInfo :

birthTime () const
fileTime (QFile::FileTime time ) const
metadataChangeTime () const

QIODevice :

skip (qint64 maxSize )

QProcess :

startDetached (qint64 * pid )

QTextCodec :

canEncode (QStringView s ) const
fromUnicode (QStringView str ) const

QTextEncoder :

fromUnicode (QStringView str )

QByteArray :

back ()
back () const
chopped (int len ) const
front ()
front () const
shrink_to_fit ()

QHash :

constKeyValueBegin () const
constKeyValueEnd () const
keyValueBegin ()
keyValueBegin () const
keyValueEnd ()
keyValueEnd () const

QJsonArray :

operator= (QJsonArray && other )
swap (QJsonArray & other )

QJsonDocument :

operator= (QJsonDocument && other )
operator[] (QLatin1String key ) const
operator[] (const QString & key ) const
operator[] (int i ) const
swap (QJsonDocument & other )

QJsonObject :

operator= (QJsonObject && other )
swap (QJsonObject & other )

QJsonValue :

operator= (QJsonValue && other )
operator[] (QLatin1String key ) const
operator[] (const QString & key ) const
operator[] (int i ) const
swap (QJsonValue & other )

QLatin1String :

back () const
begin () const
cbegin () const
cend () const
chop (int length )
chopped (int length ) const
crbegin () const
crend () const
end () const
front () const
isEmpty () const
isNull () const
rbegin () const
rend () const
trimmed () const
truncate (int length )

QLocale :

formattedDataSize (qint64 bytes , int precision , QLocale::DataSizeFormats format )
toDouble (QStringView s , bool * ok ) const
toFloat (QStringView s , bool * ok ) const
toInt (QStringView s , bool * ok ) const
toLongLong (QStringView s , bool * ok ) const
toShort (QStringView s , bool * ok ) const
toString (const QDate & date , QStringView format ) const
toString (const QDateTime & dateTime , QStringView format ) const
toString (const QTime & time , QStringView format ) const
toUInt (QStringView s , bool * ok ) const
toULongLong (QStringView s , bool * ok ) const
toUShort (QStringView s , bool * ok ) const

QMap :

constKeyValueBegin () const
constKeyValueEnd () const
keyValueBegin ()
keyValueBegin () const
keyValueEnd ()
keyValueEnd () const

QMetaObject :

invokeMethod (QObject * context , Functor function , FunctorReturnType * ret )
invokeMethod (QObject * context , Functor function , Qt::ConnectionType type , FunctorReturnType * ret )

QRegularExpressionMatch :

captured (QStringView name ) const
capturedEnd (QStringView name ) const
capturedLength (QStringView name ) const
capturedRef (QStringView name ) const
capturedStart (QStringView name ) const
capturedView (QStringView name ) const
capturedView (int nth ) const

QSettings :

isAtomicSyncRequired () const
setAtomicSyncRequired (bool enable )

QString :

arg (QLatin1String a , int fieldWidth , QChar fillChar ) const
arg (QStringView a , int fieldWidth , QChar fillChar ) const
back ()
back () const
chopped (int len ) const
endsWith (QStringView str , Qt::CaseSensitivity cs ) const
front ()
front () const
shrink_to_fit ()
startsWith (QStringView str , Qt::CaseSensitivity cs ) const

QStringList :

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

QStringRef :

back () const
chopped (int len ) const
endsWith (QStringView str , Qt::CaseSensitivity cs ) const
front () const
startsWith (QStringView str , Qt::CaseSensitivity cs ) const

QThread :

create (Function && f )
create (Function && f , Args &&... args )

QVarLengthArray :

shrink_to_fit ()

QUuid :

fromString (QLatin1String text )
fromString (QStringView text )

QVector :

shrink_to_fit ()

QVersionNumber :

fromString (QLatin1String string , int * suffixIndex )
fromString (QStringView string , int * suffixIndex )

QGuiApplication :

screenAt (const QPoint & point )

QImage :

sizeInBytes () const

QNativeGestureEvent :

device () const

QColor :

isValidColor (QStringView name )
setNamedColor (QStringView name )

QPdfWriter :

pdfVersion () const
setPdfVersion (QPagedPaintDevice::PdfVersion version )

QPolygon :

intersects (const QPolygon & p ) const

QPolygonF :

intersects (const QPolygonF & p ) const

QSurfaceFormat :

colorSpace () const
setColorSpace (QSurfaceFormat::ColorSpace colorSpace )

QWindow :

setWindowStates (Qt::WindowStates state )
windowStates () const

QTextOption :

setTabStopDistance (qreal tabStopDistance )
tabStopDistance () const

QPlatformCursor :

virtual clearOverrideCursor ()
virtual setOverrideCursor ( const QCursor & )

QPlatformIntegration :

virtual createPlatformVulkanInstance (QVulkanInstance * instance ) const

QHostInfo :

operator= (QHostInfo && other )
swap (QHostInfo & other )

QLocalServer :

socketDescriptor () const

QNetworkAccessManager :

enableStrictTransportSecurityStore (bool enabled , const QString & storeDir )
isStrictTransportSecurityStoreEnabled () const

QGeoPath :

size () const

QGeoPolygon :

size () const

QPrinter :

pdfVersion () const
setPdfVersion (QPagedPaintDevice::PdfVersion version )

QQmlEngine :

retranslate ()

QQuickItem :

acceptTouchEvents () const
setAcceptTouchEvents (bool enabled )
setSize (const QSizeF & size )
size () const

QQuickWindow :

setTextRenderType (QQuickWindow::TextRenderType renderType )
textRenderType ()

QCanBusFrame :

hasLocalEcho () const
setLocalEcho (bool echo )

QSqlError :

operator= (QSqlError && other )
swap (QSqlError & other )

QSqlQueryModel :

virtual roleNames () const override

QAbstractItemView :

isPersistentEditorOpen (const QModelIndex & index ) const

QLineEdit :

selectionEnd () const
selectionLength () const

QListWidget :

isPersistentEditorOpen (QListWidgetItem * item ) const

QOpenGLWidget :

setTextureFormat (GLenum texFormat )
textureFormat () const

QTableWidget :

isPersistentEditorOpen (QTableWidgetItem * item ) const

QTreeWidget :

isPersistentEditorOpen (QTreeWidgetItem * item , int column ) const

QX11Info :

generatePeekerId ()
peekEventQueue (QX11Info::PeekerCallback peeker , void * peekerData , QX11Info::PeekOptions option , qint32 peekerId )
removePeekerId (qint32 peekerId )

QAbstractOAuth2 :

virtual post (const QUrl & url , QHttpMultiPart * multiPart )
virtual post (const QUrl & url , const QByteArray & data )
virtual put (const QUrl & url , QHttpMultiPart * multiPart )
virtual put (const QUrl & url , const QByteArray & data )

名称空间中的新函数

bindService (const QAndroidIntent & serviceIntent , const QAndroidServiceConnection & serviceConnection , QtAndroid::BindFlags flags )
checkPermission (const QString & permission )
hideSplashScreen (int duration )
keySequence (QWindow * window , const QKeySequence & keySequence )
keySequence (QWidget * widget , const QKeySequence & keySequence )
qWaitFor (Functor predicate , int timeout )
requestPermissions (const QStringList & permissions , const QtAndroid::PermissionResultCallback & callbackFunc )
requestPermissionsSync (const QStringList & permissions , int timeoutMs )
shouldShowRequestPermissionRationale (const QString & permission )

新全局函数

operator!= (const QVulkanLayer & lhs , const QVulkanLayer & rhs )
operator!= (const QVulkanExtension & lhs , const QVulkanExtension & rhs )
operator!= (const QCursor & lhs , const QCursor & rhs )
operator== (const QVulkanLayer & lhs , const QVulkanLayer & rhs )
operator== (const QVulkanExtension & lhs , const QVulkanExtension & rhs )
operator== (const QCursor & lhs , const QCursor & rhs )
qHash (const QVulkanLayer & key , uint seed )
qHash (const QVulkanExtension & key , uint seed )
qHash (QStringView key , uint seed )

新枚举类型

enum FileTime { FileAccessTime, FileBirthTime, FileMetadataChangeTime, FileModificationTime }
enum DataSizeFormat { DataSizeBase1000, DataSizeSIQuantifiers, DataSizeIecFormat, DataSizeTraditionalFormat, DataSizeSIFormat }
enum Capability { OverrideCursor }
enum TextRenderType { QtTextRendering, NativeTextRendering }
enum Flag { NoDebugOutputRedirect }
enum PeekOption { PeekDefault, PeekFromCachedIndex }
enum BindFlag { None, AutoCreate, DebugUnbind, NotForeground, ..., ExternalService }
enum PermissionResult { Granted, Denied }

新的 Typedef

typedef const_key_value_iterator
typedef key_value_iterator
typedef const_iterator
typedef const_reverse_iterator
typedef difference_type
typedef iterator
typedef reference
typedef reverse_iterator
typedef size_type
typedef value_type
typedef const_key_value_iterator
typedef key_value_iterator
typedef PeekerCallback
typedef qint16_be
typedef qint16_le
typedef qint32_be
typedef qint32_le
typedef qint64_be
typedef qint64_le
typedef qsizetype
typedef quint16_be
typedef quint16_le
typedef quint32_be
typedef quint32_le
typedef quint64_be
typedef quint64_le

新特性

新 QML 类型

A
AbstractSkeleton
动作
ActionGroup
Armature
B
BlitFramebuffer
C
ConicalGradient
D
DiffuseSpecularMaterial
J
Joint
L
LineWidth
LinearGradient
M
MenuBar
MenuBarItem
MultiPointHandler
O
Overlay
P
PointerDeviceHandler
PointerHandler
ProximityFilter
R
RadialGradient
S
ShaderProgramBuilder
Shape
ShapeGradient
ShapePath
Skeleton
SkeletonLoader
X
XdgPopupV6
XdgShellV6
XdgSurfaceV6
XdgToplevelV6

新 QML 特性

advance
boundsMovement
defaultSuffix
font.kerning
font.kerning
font.kerning
font.preferShaping
font.preferShaping
font.preferShaping
layer.samples
manufacturer
model
samples
serialNumber
supportedFocusPointModes
tabStopDistance

新 QML 方法

addMapItemView ()
alignCoordinateToPoint ()
removeMapItemView ()
setBearing ()
setPath ()
polygon ()
polygon ()
shapeToPolygon ()
keySequence ()

其它 Qt 5 发行的补充