Qt 5.8 中的新类和函数

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

新名称空间

namespace QScxmlExecutableContent

新类

A
QAbstractOAuth
QAbstractOAuth2
QAbstractOAuthReplyHandler
AssignmentInfo ( QScxmlExecutableContent )
QAxisAccumulator ( Qt3DInput )
C
QCanBus
QCanBusDevice
QCanBusFactory
QCanBusFrame
QCandlestickLegendMarker
QCandlestickModelMapper
QCandlestickSeries
QCandlestickSet
D
QDeadlineTimer
E
EvaluatorInfo ( QScxmlExecutableContent )
F
Filter ( QCanBusDevice )
ForeachLoopBody ( QScxmlDataModel )
ForeachInfo ( QScxmlExecutableContent )
H
QHCandlestickModelMapper
I
InvokeInfo ( QScxmlExecutableContent )
L
Loader ( QScxmlCompiler )
M
QModbusClient
QModbusDataUnit
QModbusDevice
QModbusDeviceIdentification
QModbusExceptionResponse
QModbusPdu
QModbusReply
QModbusRequest
QModbusResponse
QModbusRtuSerialSlave
QModbusServer
QModbusTcpClient
QModbusTcpServer
N
QNetworkDatagram
O
QOAuth2AuthorizationCodeFlow
QOpenGLTextureBlitter
P
QPointingDeviceUniqueId
ParameterInfo ( QScxmlExecutableContent )
QPaintedTextureImage ( Qt3DRender )
R
QRenderCapture ( Qt3DRender )
QRenderCaptureReply ( Qt3DRender )
S
QSGImageNode
QSGRectangleNode
QSGRenderNode
QSGRendererInterface
QSctpServer
QSctpSocket
QScxmlDynamicScxmlServiceFactory
QScxmlInvokableService
QScxmlInvokableServiceFactory
QScxmlStaticScxmlServiceFactory
QScxmlTableData
QSslDiffieHellmanParameters
T
TimeStamp ( QCanBusFrame )
TakeRowResult ( QFormLayout )
V
QVCandlestickModelMapper
W
QWaylandBufferRef
QWaylandClient
QWaylandCompositor
QWaylandIviApplication
QWaylandIviSurface
QWaylandKeyboard
QWaylandOutput
QWaylandOutputMode
QWaylandPointer
QWaylandQuickItem
QWaylandQuickShellSurfaceItem
QWaylandSeat
QWaylandShellSurface
QWaylandSurface
QWaylandSurfaceGrabber
QWaylandTouch
QWaylandView
QWaylandWlShell
QWaylandWlShellSurface
QWaylandXdgPopupV5
QWaylandXdgShellV5
QWaylandXdgSurfaceV5

新成员函数

QLibraryInfo :

QVersionNumber version ()

QMetaEnum :

bool isScoped () const

QTimer :

std::chrono::milliseconds intervalAsDuration () const
std::chrono::milliseconds remainingTimeAsDuration () const
void singleShot (std::chrono::milliseconds msec , const QObject * receiver , const char * member )
void singleShot (std::chrono::milliseconds msec , Qt::TimerType timerType , const QObject * receiver , const char * member )
void start (std::chrono::milliseconds msec )

QMutex :

bool try_lock ()
bool try_lock_for (std::chrono::duration<Rep, Period> duration )
bool try_lock_until (std::chrono::time_point<Clock, Duration> timePoint )

QSizeF :

QSizeF fromCGSize (CGSize size )
CGSize toCGSize () const

QWaitCondition :

void notify_all ()
void notify_one ()

QCommandLineOption :

Flags flags () const
void setFlags (Flags flags )

QDateTime :

qint64 currentSecsSinceEpoch ()
QDateTime fromSecsSinceEpoch (qint64 secs , Qt::TimeSpec spec = Qt::LocalTime, int offsetSeconds = 0)
QDateTime fromSecsSinceEpoch (qint64 secs , const QTimeZone & timeZone )
void setSecsSinceEpoch (qint64 secs )
qint64 toSecsSinceEpoch () const

QLine :

QPoint center () const

QLineF :

QPointF center () const

QRect :

CGRect toCGRect () const

QPoint :

CGPoint toCGPoint () const

QPointF :

QPointF fromCGPoint (CGPoint point )
CGPoint toCGPoint () const

QRectF :

QRectF fromCGRect (CGRect rect )
CGRect toCGRect () const

QSize :

CGSize toCGSize () const

QLatin1String :

QLatin1Char at (int pos ) const
QLatin1String left (int length ) const
QLatin1String mid (int start ) const
QLatin1String mid (int start , int length ) const
QLatin1Char operator[] (int pos ) const
QLatin1String right (int length ) const

QStringList :

QString join (QLatin1String separator ) const

QStringRef :

void chop (int n )
int compare (const QByteArray & other , Qt::CaseSensitivity cs = Qt::CaseSensitive) const

TouchPoint :

qreal rotation () const
QPointingDeviceUniqueId uniqueId () const

QOpenGLContext :

QFunctionPointer getProcAddress (const char * procName ) const

QPlatformTheme :

virtual QIcon fileIcon (const QFileInfo & fileInfo , QPlatformTheme::IconOptions iconOptions = 0) const

QColor :

bool isValidColor (QLatin1String name )
void setNamedColor (QLatin1String name )

QRegion :

const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
const_reverse_iterator crbegin () const
const_reverse_iterator crend () const
const_iterator end () const
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const

QAbstractTextDocumentLayout :

QTextFormat formatAt (const QPointF & pos ) const
QString imageAt (const QPointF & pos ) const

QFontMetrics :

int capHeight () const

QFontMetricsF :

qreal capHeight () const

QRawFont :

qreal capHeight () const

QNetworkAccessManager :

QNetworkReply * sendCustomRequest (const QNetworkRequest & request , const QByteArray & verb , const QByteArray & data )
QNetworkReply * sendCustomRequest (const QNetworkRequest & request , const QByteArray & verb , QHttpMultiPart * multiPart )

QHostAddress :

bool isEqual (const QHostAddress & other , ConversionMode mode = TolerantConversion) const
QHostAddress & operator= (SpecialAddress address )
void setAddress (SpecialAddress address )

QNetworkProxyFactory :

bool usesSystemConfiguration ()

QSslConfiguration :

QSslDiffieHellmanParameters diffieHellmanParameters () const
QByteArray preSharedKeyIdentityHint () const
void setDiffieHellmanParameters (const QSslDiffieHellmanParameters & dhparams )
void setPreSharedKeyIdentityHint (const QByteArray & hint )

QFormLayout :

void removeRow (int row )
void removeRow (QWidget * widget )
void removeRow (QLayout * layout )
TakeRowResult takeRow (int row )
TakeRowResult takeRow (QWidget * widget )
TakeRowResult takeRow (QLayout * layout )

QUndoStack :

void resetClean ()

QMainWindow :

void tabifiedDockWidgetActivated (QDockWidget * dockWidget )

QBluetoothDeviceDiscoveryAgent :

int lowEnergyDiscoveryTimeout () const
void setLowEnergyDiscoveryTimeout (int timeout )
void start (DiscoveryMethods methods )
DiscoveryMethods supportedDiscoveryMethods ()

QLowEnergyController :

QBluetoothUuid remoteDeviceUuid () const

QJSEngine :

QJSValue newQMetaObject (const QMetaObject * metaObject )
QJSValue newQMetaObject ()

QJSValue :

bool isQMetaObject () const
const QMetaObject * toQMetaObject () const

QQmlEngine :

void exit (int retCode )

QQuickWindow :

QSGImageNode * createImageNode () const
QSGNinePatchNode * createNinePatchNode () const
QSGRectangleNode * createRectangleNode () const
QSGRendererInterface * rendererInterface () const
void setSceneGraphBackend (QSGRendererInterface::GraphicsApi api )
void setSceneGraphBackend (const QString & backend )

QSGEngine :

QSGImageNode * createImageNode () const
QSGNinePatchNode * createNinePatchNode () const
QSGRectangleNode * createRectangleNode () const
QSGRendererInterface * rendererInterface () const

QQuickStyle :

void setFallbackStyle (const QString & style )

QSerialPort :

void errorOccurred (QSerialPort::SerialPortError error )

QQuickWebEngineProfile :

QStringList spellCheckLanguages () const

QWebEngineContextMenuData :

QString misspelledWord () const
QStringList spellCheckerSuggestions () const

QWebEngineDownloadItem :

DownloadType type () const

QWebEngineProfile :

bool isSpellCheckEnabled () const
void setSpellCheckEnabled (bool enable )
void setSpellCheckLanguages (const QStringList & languages )
QStringList spellCheckLanguages () const

QWebEnginePage :

void print (QPrinter * printer , FunctorOrLambda resultCallback )
void replaceMisspelledWord (const QString & replacement )
void save (const QString & filePath , QWebEngineDownloadItem::SavePageFormat format = QWebEngineDownloadItem::MimeHtmlSaveFormat) const

QWebSocket :

void preSharedKeyAuthenticationRequired (QSslPreSharedKeyAuthenticator * authenticator )

QWebSocketServer :

void preSharedKeyAuthenticationRequired (QSslPreSharedKeyAuthenticator * authenticator )

名称空间中的新函数

QAndroidJniObject androidContext ()
qreal convertVolume (qreal volume , VolumeScale from , VolumeScale to )
QTouchDevice * createTouchDevice (QTouchDevice::DeviceType devType = QTouchDevice::TouchScreen)
char * toString ( std::nullptr_t )

新全局函数

bool operator!= (QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )
bool operator!= ( std::nullptr_t , const QWeakPointer<T> & rhs )
bool operator!= (const QWeakPointer<T> & lhs , std::nullptr_t )
bool operator!= ( std::nullptr_t , const QSharedPointer<T> & rhs )
bool operator!= (const QSharedPointer<T> & lhs , std::nullptr_t )
bool operator!= ( std::nullptr_t , const QScopedPointer<T, Cleanup> & rhs )
bool operator!= (const QScopedPointer<T, Cleanup> & lhs , std::nullptr_t )
QDebug operator<< (QDebug debug , const QSslDiffieHellmanParameters & dhparam )
bool operator== (const QSslDiffieHellmanParameters & lhs , const QSslDiffieHellmanParameters & rhs )
bool operator== (QPointingDeviceUniqueId lhs , QPointingDeviceUniqueId rhs )
bool operator== ( std::nullptr_t , const QWeakPointer<T> & rhs )
bool operator== (const QWeakPointer<T> & lhs , std::nullptr_t )
bool operator== ( std::nullptr_t , const QSharedPointer<T> & rhs )
bool operator== (const QSharedPointer<T> & lhs , std::nullptr_t )
bool operator== ( std::nullptr_t , const QScopedPointer<T, Cleanup> & rhs )
bool operator== (const QScopedPointer<T, Cleanup> & lhs , std::nullptr_t )
uint qHash (const QSslDiffieHellmanParameters & dhparam , uint seed = 0)
uint qHash (const QRawFont & font , uint seed = 0)
uint qHash (QPointingDeviceUniqueId key , uint seed = 0)
uint qHash (const QMultiHash<Key, T> & key , uint seed = 0)
uint qHash (const QHash<Key, T> & key , uint seed = 0)
int qmlRegisterUncreatableMetaObject (const QMetaObject & staticMetaObject , const char * uri , int versionMajor , int versionMinor , const char * qmlName , const QString & reason )

新宏

QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
Q_ENUM_NS ( ... )
void Q_FALLTHROUGH ()
Q_FLAG_NS ( ... )
Q_NAMESPACE

新枚举类型

enum VolumeScale { LinearVolumeScale, CubicVolumeScale, LogarithmicVolumeScale, DecibelVolumeScale }
enum DiscoveryMethod { NoMethod, ClassicMethod, LowEnergyMethod }
enum ConversionModeFlag { StrictConversion, ConvertV4MappedToIPv4, ConvertV4CompatToIPv4, ConvertLocalHost, ConvertUnspecifiedAddress, TolerantConversion }
enum LegendMarkerType { LegendMarkerTypeArea, LegendMarkerTypeBar, LegendMarkerTypePie, LegendMarkerTypeXY, LegendMarkerTypeBoxPlot, LegendMarkerTypeCandlestick }
enum DownloadType { Attachment, DownloadAttribute, UserRequested, SavePage }

新的 Typedef

typedef QModbusDataUnitMap
typedef const_iterator
typedef const_reverse_iterator
typedef ContainerId
typedef EvaluatorId
typedef InstructionId
typedef StringId

新特性

新 QML 类型

A
AxisAccumulator
B
BorderImageMesh
C
ColorDialog
D
Dialog
DialogButtonBox
F
FileDialog
FolderDialog
FontDialog
I
IviApplication
IviSurface
L
LoggingCategory
M
Menu
MenuBar
MenuItem
MenuItemGroup
MenuSeparator
MessageDialog
R
RenderCapture
RenderCaptureReply
RoundButton
S
ShellSurface
ShellSurfaceItem
StandardPaths
SystemTrayIcon
T
ToolSeparator
W
WaylandClient
WaylandCompositor
WaylandOutput
WaylandQuickItem
WaylandSeat
WaylandSurface
WaylandView
WlShell
WlShellSurface
X
XdgPopupV5
XdgShellV5
XdgSurfaceV5

新 QML 特性

delayed
font.hintingPreference
font.hintingPreference
font.hintingPreference
imageSource
overwriteMode
overwriteMode

新 QML 信号

binaryMessageReceived (QString message )

新 QML 方法

callLater ( function , argument1 , argument2 , ... )
callLater ( function )
real convertVolume (real volume , VolumeScale from , VolumeScale to )
tryVerify ( function , timeout = 5000, message = "")
void sendBinaryMessage (ArrayBuffer message )

其它 Qt 5 发行的补充