Qt 5.7 中的新类和函数

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

新类

A
AddressInfo ( QLowEnergyAdvertisingParameters )
QAbstractActionInput ( Qt3DInput )
QAction ( Qt3DInput )
QActionInput ( Qt3DInput )
QAnalogAxisInput ( Qt3DInput )
QAxis ( Qt3DInput )
QAbstractFunctor ( Qt3DRender )
QAlphaCoverage ( Qt3DRender )
QAlphaTest ( Qt3DRender )
B
QButtonAxisInput ( Qt3DInput )
QBlendEquation ( Qt3DRender )
C
QConeGeometry ( Qt3DExtras )
QCuboidGeometry ( Qt3DExtras )
QCylinderGeometry ( Qt3DExtras )
QClearBuffers ( Qt3DRender )
QColorMask ( Qt3DRender )
QComputeCommand ( Qt3DRender )
QCullFace ( Qt3DRender )
D
QDiffuseMapMaterial ( Qt3DExtras )
QDiffuseSpecularMapMaterial ( Qt3DExtras )
QDepthTest ( Qt3DRender )
QDirectionalLight ( Qt3DRender )
QDispatchCompute ( Qt3DRender )
QDithering ( Qt3DRender )
E
QEffect ( Qt3DRender )
F
QFirstPersonCameraController ( Qt3DExtras )
QForwardRenderer ( Qt3DExtras )
QFrontFace ( Qt3DRender )
QFrustumCulling ( Qt3DRender )
G
QGoochMaterial ( Qt3DExtras )
QGeometry ( Qt3DRender )
QGeometryRenderer ( Qt3DRender )
I
QInputChord ( Qt3DInput )
QInputSequence ( Qt3DInput )
QInputSettings ( Qt3DInput )
L
QLowEnergyAdvertisingData
QLowEnergyAdvertisingParameters
QLowEnergyCharacteristicData
QLowEnergyConnectionParameters
QLowEnergyDescriptorData
QLowEnergyServiceData
QLogicAspect ( Qt3DLogic )
M
QMorphPhongMaterial ( Qt3DExtras )
QMultiSampleAntiAliasing ( Qt3DRender )
N
QNodeCreatedChange ( Qt3DCore )
QNodeDestroyedChange ( Qt3DCore )
QNormalDiffuseMapAlphaMaterial ( Qt3DExtras )
QNormalDiffuseMapMaterial ( Qt3DExtras )
QNormalDiffuseSpecularMapMaterial ( Qt3DExtras )
QNoDepthMask ( Qt3DRender )
O
QOrbitCameraController ( Qt3DExtras )
P
QPerVertexColorMaterial ( Qt3DExtras )
QPhongAlphaMaterial ( Qt3DExtras )
QPhongMaterial ( Qt3DExtras )
QPlaneGeometry ( Qt3DExtras )
QPickEvent ( Qt3DRender )
QPickTriangleEvent ( Qt3DRender )
QPickingSettings ( Qt3DRender )
QPointSize ( Qt3DRender )
QPolygonOffset ( Qt3DRender )
Q
QQuickStyle
R
QRenderAspect ( Qt3DRender )
QRenderPass ( Qt3DRender )
QRenderPassFilter ( Qt3DRender )
QRenderSettings ( Qt3DRender )
QRenderState ( Qt3DRender )
QRenderSurfaceSelector ( Qt3DRender )
QRenderTarget ( Qt3DRender )
QRenderTargetOutput ( Qt3DRender )
QRenderTargetSelector ( Qt3DRender )
S
QScxmlCompiler
QScxmlCppDataModel
QScxmlDataModel
QScxmlEcmaScriptDataModel
QScxmlError
QScxmlEvent
QScxmlNullDataModel
QScxmlStateMachine
QStaticPropertyUpdatedChangeBase ( Qt3DCore )
QStaticPropertyValueAddedChangeBase ( Qt3DCore )
QStaticPropertyValueRemovedChangeBase ( Qt3DCore )
QSphereGeometry ( Qt3DExtras )
QSceneLoader ( Qt3DRender )
QScissorTest ( Qt3DRender )
QSeamlessCubemap ( Qt3DRender )
QSortPolicy ( Qt3DRender )
QStencilMask ( Qt3DRender )
QStencilOperation ( Qt3DRender )
QStencilOperationArguments ( Qt3DRender )
QStencilTest ( Qt3DRender )
QStencilTestArguments ( Qt3DRender )
T
QTorusGeometry ( Qt3DExtras )
QTechnique ( Qt3DRender )
QTechniqueFilter ( Qt3DRender )
QTextureData ( Qt3DRender )
QTextureImageDataGenerator ( Qt3DRender )
V
QViewport ( Qt3DRender )
W
QWebEngineContextMenuData

新成员函数

QAndroidJniObject :

QAndroidJniObject fromLocalRef (jobject localRef )

QUtf8 :

QChar * convertToUnicode (QChar * buffer , const char * chars , int len )

QFlags :

QFlags & setFlag (Enum flag , bool on = true)

QDataStream :

void abortTransaction ()
bool commitTransaction ()
void rollbackTransaction ()
void startTransaction ()

QIODevice :

void channelBytesWritten (int channel , qint64 bytes )
void channelReadyRead (int channel )
void commitTransaction ()
int currentReadChannel () const
int currentWriteChannel () const
bool isTransactionStarted () const
int readChannelCount () const
void rollbackTransaction ()
void setCurrentReadChannel (int channel )
void setCurrentWriteChannel (int channel )
void startTransaction ()
int writeChannelCount () const

QProcess :

CreateProcessArgumentModifier createProcessArgumentsModifier () const
void setCreateProcessArgumentsModifier (CreateProcessArgumentModifier modifier )

QJsonObject :

const_iterator constFind (QLatin1String key ) const
bool contains (QLatin1String key ) const
iterator find (QLatin1String key )
const_iterator find (QLatin1String key ) const
QJsonValue operator[] (QLatin1String key ) const
QJsonValueRef operator[] (QLatin1String key )
QJsonValue value (QLatin1String key ) const

QMetaObject :

bool inherits (const QMetaObject * metaObject ) const

QUuid :

QUuid fromCFUUID (CFUUIDRef uuid )
QUuid fromNSUUID (const NSUUID * uuid )
CFUUIDRef toCFUUID () const
NSUUID * toNSUUID () const

QBasicMutex :

bool isRecursive () const

QMutex :

bool isRecursive () const

QByteArray :

QByteArray & append (int count , char ch )
QByteArray & insert (int i , int count , char ch )
QByteArray & prepend (int count , char ch )

QHash :

QPair<iterator, iterator> equal_range (const Key & key )
QPair<const_iterator, const_iterator> equal_range (const Key & key ) const
iterator erase (const_iterator pos )

QLocale :

QString toCurrencyString (double value , const QString & symbol , int precision ) const

QRect :

QRect transposed () const

QRectF :

QRectF transposed () const

QSet :

iterator erase (const_iterator pos )

QString :

void resize (int size , QChar fillChar )

QStringRef :

const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
QChar operator[] (int position ) const
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const

QIconEngine :

bool isNull () const

Key :

bool isValid () const

QDrag :

void cancel ()

QWheelEvent :

bool inverted () const

QPlatformDrag :

virtual void cancelDrag ()

QPlatformIntegration :

virtual void beep () const

QOpenGLFramebufferObject :

void blitFramebuffer (QOpenGLFramebufferObject * target , const QRect & targetRect , QOpenGLFramebufferObject * source , const QRect & sourceRect , GLbitfield buffers , GLenum filter , int readColorAttachmentIndex , int drawColorAttachmentIndex , FramebufferRestorePolicy restorePolicy )

QWindowsWindowFunctions :

void setWindowActivationBehavior (WindowActivationBehavior behavior )
const QByteArray setWindowActivationBehaviorIdentifier ()

QNetworkInterface :

int interfaceIndexFromName (const QString & name )
QString interfaceNameFromIndex (int index )

QSslConfiguration :

QSslKey ephemeralServerKey () const

QMenu :

void showTearOffMenu ()
void showTearOffMenu (const QPoint & pos )

QBluetoothUuid :

bool operator!= (const QBluetoothUuid & other ) const

QLowEnergyController :

QLowEnergyService * addService (const QLowEnergyServiceData & service , QObject * parent = nullptr)
void connectionUpdated (const QLowEnergyConnectionParameters & newParameters )
QLowEnergyController * createCentral (const QBluetoothDeviceInfo & remoteDevice , QObject * parent = nullptr)
QLowEnergyController * createPeripheral (QObject * parent = nullptr)
void requestConnectionUpdate (const QLowEnergyConnectionParameters & 参数 )
角色 role () const
void startAdvertising (const QLowEnergyAdvertisingParameters & 参数 , const QLowEnergyAdvertisingData & advertisingData , const QLowEnergyAdvertisingData & scanResponseData = QLowEnergyAdvertisingData())
void stopAdvertising ()

QQmlDebuggingEnabler :

bool startDebugConnector (const QString & pluginName , const QVariantHash & configuration = QVariantHash())

QQmlFileSelector :

QFileSelector * 选择器 () const

QQuickItem :

bool isAncestorOf (const QQuickItem * child ) const
QPointF mapFromGlobal (const QPointF & point ) const
QPointF mapToGlobal (const QPointF & point ) const

QMediaPlaylist :

bool moveMedia (int from , int to )

QMediaPlaylistProvider :

virtual bool moveMedia (int from , int to )

QModbusRtuSerialMaster :

int interFrameDelay () const
void setInterFrameDelay (int microseconds )

QQuickWebEngineProfile :

void clearHttpCache ()

QWebEngineDownloadItem :

SavePageFormat savePageFormat () const
void setSavePageFormat (SavePageFormat format )

QWebEngineProfile :

void clearHttpCache ()

QWebEnginePage :

void audioMutedChanged (bool muted )
const QWebEngineContextMenuData & contextMenuData () const
void iconChanged (const QIcon & icon )
void printToPdf (const QString & filePath , const QPageLayout & pageLayout = QPageLayout( QPageSize( QPageSize::A4 ), QPageLayout::Portrait, QMarginsF() ))
void printToPdf (FunctorOrLambda resultCallback , const QPageLayout & pageLayout = QPageLayout( QPageSize( QPageSize::A4 ), QPageLayout::Portrait, QMarginsF() ))
void recentlyAudibleChanged (bool recentlyAudible )
void runJavaScript (const QString & scriptSource , quint32 worldId )
void runJavaScript (const QString & scriptSource , quint32 worldId , FunctorOrLambda resultCallback )
void setWebChannel (QWebChannel * channel , uint worldId )

QWebEngineView :

void iconChanged (const QIcon & icon )

QX11Info :

bool isCompositingManagerRunning (int screen = -1)

名称空间中的新函数

QAndroidJniObject androidService ()
void hideSplashScreen ()
void runOnAndroidThread (const Runnable & runnable )
void runOnAndroidThreadSync (const Runnable & runnable , int timeoutMs = INT_MAX)

新全局函数

QDebug operator<< (QDebug debug , const QSharedPointer<T> & ptr )
QDebug operator<< (QDebug stream , const std::multimap<Key, T, Compare, Alloc> & map )
QDebug operator<< (QDebug stream , const std::map<Key, T, Compare, Alloc> & map )
QDebug operator<< (QDebug stream , const std::list<T, Alloc> & list )
QDebug operator<< (QDebug stream , const std::vector<T, Alloc> & vector )
QtPrivate::QAddConst<T>::Type & qAsConst (T & t )
auto qConstOverload (T memberFunctionPointer )
uint qHash (const std::pair<T1, T2> & key , uint seed = 0)
auto qNonConstOverload (T memberFunctionPointer )
auto qOverload (T functionPointer )

新宏

const wchar_t * qUtf16Printable (const QString & str )

新枚举类型

enum AttAccessConstraint { AttAuthorizationRequired, AttAuthenticationRequired, AttEncryptionRequired }
enum FloatingPointPrecisionOption { FloatingPointShortest }
enum Role { CentralRole, PeripheralRole }
enum FramebufferRestorePolicy { DontRestoreFramebufferBinding, RestoreFramebufferBindingToDefault, RestoreFrameBufferBinding }
enum SavePageFormat { UnknownSaveFormat, SingleHtmlSaveFormat, CompleteHtmlSaveFormat, MimeHtmlSaveFormat }
enum WindowActivationBehavior { DefaultActivateWindow, AlwaysActivateWindow }

新的 Typedef

typedef const_reverse_iterator
typedef SetWindowActivationBehaviorType

新特性

新 QML 类型

A
AbstractActionInput
AbstractButton
动作
ActionInput
AlphaCoverage
AlphaTest
AnalogAxisInput
ApplicationWindow
Axis
B
BusyIndicator
Button
ButtonAxisInput
ButtonGroup
C
CheckBox
CheckDelegate
ClearBuffers
ColorMask
ComboBox
ComputeCommand
容器
Control
CullFace
D
DepthTest
Dial
DiffuseMapMaterial
DiffuseSpecularMapMaterial
DirectionalLight
DispatchCompute
Dithering
Drawer
E
Effect
F
FirstPersonCameraController
ForwardRenderer
Frame
FrontFace
FrustumCulling
G
几何体
GeometryRenderer
GoochMaterial
GroupBox
I
InputChord
InputSequence
InputSettings
ItemDelegate
L
Label
M
Menu
MenuItem
MultiSampleAntiAliasing
N
NoDepthMask
NormalDiffuseMapAlphaMaterial
NormalDiffuseMapMaterial
NormalDiffuseSpecularMapMaterial
O
OrbitCameraController
P
Page
PageIndicator
Pane
PerVertexColorMaterial
PhongAlphaMaterial
PhongMaterial
PickingSettings
PointSize
PolygonOffset
Popup
ProgressBar
R
RadioButton
RadioDelegate
RangeSlider
RenderPass
RenderPassFilter
RenderSettings
RenderState
RenderSurfaceSelector
RenderTarget
RenderTargetOutput
RenderTargetSelector
S
SceneLoader
ScissorTest
ScrollBar
ScrollIndicator
ScxmlStateMachine
SeamlessCubemap
Slider
SortPolicy
SpinBox
StackView
StencilMask
StencilOperation
StencilOperationArguments
StencilTest
StencilTestArguments
SwipeDelegate
SwipeView
Switch
SwitchDelegate
T
TabBar
TabButton
Technique
TechniqueFilter
TextArea
TextField
ToolBar
ToolButton
ToolTip
Tumbler
V
Viewport

新 QML 特性

brightness
caseSensitive
copyrightsVisible
enabled
invert
keyNavigationEnabled
keyNavigationEnabled
movementDirection
preeditText
preeditText
source
window

新 QML 方法

对象 mapFromGlobal (real x , real y )
对象 mapToGlobal (real x , real y )
bool addItems ( sources )
bool insertItems ( index , sources )
bool moveItem ( from , to )
bool removeItems (int start , int end )
clear ()
clear ()

其它 Qt 5 发行的补充