Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"

This commit is contained in:
Qt Forward Merge Bot 2020-01-18 01:00:07 +01:00
commit 858c5a73fc
25 changed files with 147 additions and 117 deletions

View File

@ -387,17 +387,12 @@
\snippet graphicsview/padnavigator/padnavigator.cpp 7 \snippet graphicsview/padnavigator/padnavigator.cpp 7
We now create the animations that control the flip-effect when you press We now create the animations that control the flip-effect when you press
the enter key. The main goal is to rotate the pad by 180 degrees or back, the enter key. The main goal is to rotate the pad by 180 degrees or back.
but we also need to make sure the selection item's tilt rotations are reset
back to 0 when the pad is flipped, and restored back to their original
values when flipped back:
\list \list
\li \c smoothFlipRotation: Animates the main 180 degree rotation of the pad. \li \c smoothFlipRotation: Animates the main 180 degree rotation of the pad.
\li \c smoothFlipScale: Scales the pad out and then in again while the pad is rotating. \li \c smoothFlipScale: Scales the pad out and then in again while the pad is rotating.
\li \c smoothFlipXRotation: Animates the selection item's X-tilt to 0 and back. \li \c flipAnimation: A parallel animation group that ensures the above animations are run in parallel.
\li \c smoothFlipYRotation: Animates the selection item's Y-tilt to 0 and back.
\li \c flipAnimation: A parallel animation group that ensures all the above animations are run in parallel.
\endlist \endlist
All animations are given a 500 millisecond duration and an All animations are given a 500 millisecond duration and an
@ -447,11 +442,17 @@
Each state assigns specific properties to objects on entry. Most Each state assigns specific properties to objects on entry. Most
interesting perhaps is the assignment of the value 0.0 to the pad's \c interesting perhaps is the assignment of the value 0.0 to the pad's \c
flipRotation angle property when in \c frontState, and 180.0 when in \c flipRotation angle property when in \c frontState, and 180.0 when in \c
backState. At the end of this section we register default animations with backState.
the state engine; these animations will apply to their respective objects
and properties for any state transition. Otherwise it's common to assign At the end of this section we register default animations with the state
engine; these animations will apply to their respective objects and
properties for any state transition. Otherwise it's common to assign
animations to specific transitions. animations to specific transitions.
Specifically, we use default animations to control the selection item's
movement and tilt rotations. The tilt rotations are set to 0 when the pad
is flipped, and restored back to their original values when flipped back.
The \c splashState state is set as the initial state. This is required The \c splashState state is set as the initial state. This is required
before we start the state engine. We proceed with creating some before we start the state engine. We proceed with creating some
transitions. transitions.

View File

@ -142,24 +142,16 @@ PadNavigator::PadNavigator(const QSize &size, QWidget *parent)
// Flip animation setup // Flip animation setup
QPropertyAnimation *smoothFlipRotation = new QPropertyAnimation(flipRotation, "angle"); QPropertyAnimation *smoothFlipRotation = new QPropertyAnimation(flipRotation, "angle");
QPropertyAnimation *smoothFlipScale = new QPropertyAnimation(pad, "scale"); QPropertyAnimation *smoothFlipScale = new QPropertyAnimation(pad, "scale");
QPropertyAnimation *smoothFlipXRotation = new QPropertyAnimation(xRotation, "angle");
QPropertyAnimation *smoothFlipYRotation = new QPropertyAnimation(yRotation, "angle");
QParallelAnimationGroup *flipAnimation = new QParallelAnimationGroup(this); QParallelAnimationGroup *flipAnimation = new QParallelAnimationGroup(this);
smoothFlipScale->setDuration(500); smoothFlipScale->setDuration(500);
smoothFlipRotation->setDuration(500); smoothFlipRotation->setDuration(500);
smoothFlipXRotation->setDuration(500);
smoothFlipYRotation->setDuration(500);
smoothFlipScale->setEasingCurve(QEasingCurve::InOutQuad); smoothFlipScale->setEasingCurve(QEasingCurve::InOutQuad);
smoothFlipRotation->setEasingCurve(QEasingCurve::InOutQuad); smoothFlipRotation->setEasingCurve(QEasingCurve::InOutQuad);
smoothFlipXRotation->setEasingCurve(QEasingCurve::InOutQuad);
smoothFlipYRotation->setEasingCurve(QEasingCurve::InOutQuad);
smoothFlipScale->setKeyValueAt(0, qvariant_cast<qreal>(1.0)); smoothFlipScale->setKeyValueAt(0, qvariant_cast<qreal>(1.0));
smoothFlipScale->setKeyValueAt(0.5, qvariant_cast<qreal>(0.7)); smoothFlipScale->setKeyValueAt(0.5, qvariant_cast<qreal>(0.7));
smoothFlipScale->setKeyValueAt(1, qvariant_cast<qreal>(1.0)); smoothFlipScale->setKeyValueAt(1, qvariant_cast<qreal>(1.0));
flipAnimation->addAnimation(smoothFlipRotation); flipAnimation->addAnimation(smoothFlipRotation);
flipAnimation->addAnimation(smoothFlipScale); flipAnimation->addAnimation(smoothFlipScale);
flipAnimation->addAnimation(smoothFlipXRotation);
flipAnimation->addAnimation(smoothFlipYRotation);
//! [7] //! [7]
//! [8] //! [8]

View File

@ -47,7 +47,7 @@ depends += \
qtnetwork \ qtnetwork \
qtopengl \ qtopengl \
qtprintsupport \ qtprintsupport \
qtqml \ qtqml qtqmltest \
qtquick \ qtquick \
qtquickcontrols \ qtquickcontrols \
qtquickdialogs \ qtquickdialogs \

View File

@ -5443,8 +5443,8 @@
\li The exit code of the test will be ignored during \c{make check}. \li The exit code of the test will be ignored during \c{make check}.
\endtable \endtable
Test cases will often be written with \l{QTest} or \l[QML]{TestCase}, but Test cases will often be written with \l{QTest} or \c{TestCase}, but
that is not a requirement to make use of \c{CONFIG+=testcase} and \c{make check}. it is not a requirement to make use of \c{CONFIG+=testcase} and \c{make check}.
The only primary requirement is that the test program exit with a zero exit code The only primary requirement is that the test program exit with a zero exit code
on success, and a non-zero exit code on failure. on success, and a non-zero exit code on failure.

View File

@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags tagfile = ../../../doc/qtcore/qtcore.tags
depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake qtwinextras qtqml depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake qtwinextras qtqml qtcmake
headerdirs += .. headerdirs += ..

View File

@ -56,7 +56,7 @@
\include module-use.qdocinc using qt module \include module-use.qdocinc using qt module
\quotefile overview/using-qt-core.cmake \quotefile overview/using-qt-core.cmake
See also the \l[QtDoc]{Build with CMake} overview. See also the \l{Build with CMake} overview.
\section2 Building with qmake \section2 Building with qmake

View File

@ -192,7 +192,6 @@ QT_BEGIN_NAMESPACE
an in-place swap (if necessary). If they are not the same, the memory an in-place swap (if necessary). If they are not the same, the memory
regions must not overlap. regions must not overlap.
\sa qFromLittleEndian()
\sa qToBigEndian() \sa qToBigEndian()
\sa qToLittleEndian() \sa qToLittleEndian()
*/ */

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2016 Intel Corporation.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
@ -106,11 +106,11 @@ struct QSystemLocalePrivate
{ {
QSystemLocalePrivate(); QSystemLocalePrivate();
QChar zeroDigit(); QString zeroDigit();
QChar decimalPoint(); QString decimalPoint();
QChar groupSeparator(); QString groupSeparator();
QChar negativeSign(); QString negativeSign();
QChar positiveSign(); QString positiveSign();
QVariant dateFormat(QLocale::FormatType); QVariant dateFormat(QLocale::FormatType);
QVariant timeFormat(QLocale::FormatType); QVariant timeFormat(QLocale::FormatType);
QVariant dateTimeFormat(QLocale::FormatType); QVariant dateTimeFormat(QLocale::FormatType);
@ -147,12 +147,11 @@ private:
WCHAR lcName[LOCALE_NAME_MAX_LENGTH]; WCHAR lcName[LOCALE_NAME_MAX_LENGTH];
#endif #endif
SubstitutionType substitutionType; SubstitutionType substitutionType;
QChar zero; QString zero; // cached value for zeroDigit()
int getLocaleInfo(LCTYPE type, LPWSTR data, int size); int getLocaleInfo(LCTYPE type, LPWSTR data, int size);
QString getLocaleInfo(LCTYPE type, int maxlen = 0); QString getLocaleInfo(LCTYPE type, int maxlen = 0);
int getLocaleInfo_int(LCTYPE type, int maxlen = 0); int getLocaleInfo_int(LCTYPE type, int maxlen = 0);
QChar getLocaleInfo_qchar(LCTYPE type);
int getCurrencyFormat(DWORD flags, LPCWSTR value, const CURRENCYFMTW *format, LPWSTR data, int size); int getCurrencyFormat(DWORD flags, LPCWSTR value, const CURRENCYFMTW *format, LPWSTR data, int size);
int getDateFormat(DWORD flags, const SYSTEMTIME * date, LPCWSTR format, LPWSTR data, int size); int getDateFormat(DWORD flags, const SYSTEMTIME * date, LPCWSTR format, LPWSTR data, int size);
@ -236,12 +235,6 @@ int QSystemLocalePrivate::getLocaleInfo_int(LCTYPE type, int maxlen)
return ok ? v : 0; return ok ? v : 0;
} }
QChar QSystemLocalePrivate::getLocaleInfo_qchar(LCTYPE type)
{
QString str = getLocaleInfo(type);
return str.isEmpty() ? QChar() : str.at(0);
}
QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution() QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution()
{ {
if (substitutionType == SUnknown) { if (substitutionType == SUnknown) {
@ -257,13 +250,12 @@ QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution()
else if (buf[0] == '2') else if (buf[0] == '2')
substitutionType = QSystemLocalePrivate::SAlways; substitutionType = QSystemLocalePrivate::SAlways;
else { else {
wchar_t digits[11]; wchar_t digits[11]; // See zeroDigit() for why 11.
if (!getLocaleInfo(LOCALE_SNATIVEDIGITS, digits, 11)) { if (!getLocaleInfo(LOCALE_SNATIVEDIGITS, digits, 11)) {
substitutionType = QSystemLocalePrivate::SNever; substitutionType = QSystemLocalePrivate::SNever;
return substitutionType; return substitutionType;
} }
const wchar_t zero = digits[0]; if (buf[0] == digits[0] + 2)
if (buf[0] == zero + 2)
substitutionType = QSystemLocalePrivate::SAlways; substitutionType = QSystemLocalePrivate::SAlways;
else else
substitutionType = QSystemLocalePrivate::SNever; substitutionType = QSystemLocalePrivate::SNever;
@ -274,40 +266,75 @@ QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution()
QString &QSystemLocalePrivate::substituteDigits(QString &string) QString &QSystemLocalePrivate::substituteDigits(QString &string)
{ {
ushort zero = zeroDigit().unicode(); zeroDigit(); // Ensure zero is set.
ushort *qch = reinterpret_cast<ushort *>(string.data()); switch (zero.size()) {
for (ushort *end = qch + string.size(); qch != end; ++qch) { case 1: {
if (*qch >= '0' && *qch <= '9') const ushort offset = zero.at(0).unicode() - '0';
*qch = zero + (*qch - '0'); if (!offset) // Nothing to do
break;
Q_ASSERT(offset > 9);
ushort *const qch = reinterpret_cast<ushort *>(string.data());
for (int i = 0, stop = string.size(); i < stop; ++i) {
ushort &ch = qch[i];
if (ch >= '0' && ch <= '9')
ch += offset;
}
break;
}
case 2: {
// Surrogate pair (high, low):
uint digit = QChar::surrogateToUcs4(zero.at(0), zero.at(1));
for (int i = 0; i < 10; i++) {
const QChar s[2] = { QChar::highSurrogate(digit + i), QChar::lowSurrogate(digit + i) };
string.replace(QString(QLatin1Char('0' + i)), QString(s, 2));
}
break;
}
default:
Q_ASSERT(!"Expected zero digit to be a single UCS2 code-point or a surrogate pair");
case 0: // Apparently this locale info was not available.
break;
} }
return string; return string;
} }
QChar QSystemLocalePrivate::zeroDigit() QString QSystemLocalePrivate::zeroDigit()
{ {
if (zero.isNull()) if (zero.isEmpty()) {
zero = getLocaleInfo_qchar(LOCALE_SNATIVEDIGITS); /* Ten digits plus a terminator.
https://docs.microsoft.com/en-us/windows/win32/intl/locale-snative-constants
"Native equivalents of ASCII 0 through 9. The maximum number of
characters allowed for this string is eleven, including a terminating
null character."
*/
wchar_t digits[11];
if (getLocaleInfo(LOCALE_SNATIVEDIGITS, digits, 11)) {
// assert all(digits[i] == i + digits[0] for i in range(1, 10)), assumed above
zero = QString::fromWCharArray(digits, 1);
}
}
return zero; return zero;
} }
QChar QSystemLocalePrivate::decimalPoint() QString QSystemLocalePrivate::decimalPoint()
{ {
return getLocaleInfo_qchar(LOCALE_SDECIMAL); return getLocaleInfo(LOCALE_SDECIMAL);
} }
QChar QSystemLocalePrivate::groupSeparator() QString QSystemLocalePrivate::groupSeparator()
{ {
return getLocaleInfo_qchar(LOCALE_STHOUSAND); return getLocaleInfo(LOCALE_STHOUSAND);
} }
QChar QSystemLocalePrivate::negativeSign() QString QSystemLocalePrivate::negativeSign()
{ {
return getLocaleInfo_qchar(LOCALE_SNEGATIVESIGN); return getLocaleInfo(LOCALE_SNEGATIVESIGN);
} }
QChar QSystemLocalePrivate::positiveSign() QString QSystemLocalePrivate::positiveSign()
{ {
return getLocaleInfo_qchar(LOCALE_SPOSITIVESIGN); return getLocaleInfo(LOCALE_SPOSITIVESIGN);
} }
QVariant QSystemLocalePrivate::dateFormat(QLocale::FormatType type) QVariant QSystemLocalePrivate::dateFormat(QLocale::FormatType type)
@ -677,7 +704,7 @@ void QSystemLocalePrivate::update()
GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH); GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH);
#endif #endif
substitutionType = SUnknown; substitutionType = SUnknown;
zero = QChar(); zero.resize(0);
} }
QString QSystemLocalePrivate::winToQtFormat(QStringView sys_fmt) QString QSystemLocalePrivate::winToQtFormat(QStringView sys_fmt)
@ -749,7 +776,7 @@ QLocale QSystemLocale::fallbackUiLocale() const
return QLocale(QString::fromLatin1(getWinLocaleName())); return QLocale(QString::fromLatin1(getWinLocaleName()));
} }
QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const QVariant QSystemLocale::query(QueryType type, QVariant in) const
{ {
QSystemLocalePrivate *d = systemLocalePrivate(); QSystemLocalePrivate *d = systemLocalePrivate();
switch(type) { switch(type) {

View File

@ -1915,6 +1915,10 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
\snippet code/src_corelib_tools_qregularexpression.cpp 31 \snippet code/src_corelib_tools_qregularexpression.cpp 31
The returned regular expression is already fully anchored. In other
words, there is no need of calling anchoredPattern() again on the
result.
\warning Unlike QRegExp, this implementation follows closely the definition \warning Unlike QRegExp, this implementation follows closely the definition
of wildcard for glob patterns: of wildcard for glob patterns:
\table \table
@ -1941,12 +1945,12 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
\note The backslash (\\) character is \e not an escape char in this context. \note The backslash (\\) character is \e not an escape char in this context.
In order to match one of the special characters, place it in square brackets In order to match one of the special characters, place it in square brackets
(for example, "[?]"). (for example, \c{[?]}).
More information about the implementation can be found in: More information about the implementation can be found in:
\list \list
\li \l {https://en.wikipedia.org/wiki/Glob_(programming)} {The Wikipedia Glob article} \li \l {https://en.wikipedia.org/wiki/Glob_(programming)} {The Wikipedia Glob article}
\li \c man 7 glob \li \c {man 7 glob}
\endlist \endlist
\sa escape() \sa escape()

View File

@ -723,7 +723,7 @@ QCalendar::QCalendar(QLatin1String name)
QCalendar::QCalendar(QStringView name) QCalendar::QCalendar(QStringView name)
: d(QCalendarBackend::fromName(name)) {} : d(QCalendarBackend::fromName(name)) {}
/* /*!
\fn bool QCalendar::isValid() const \fn bool QCalendar::isValid() const
Returns true if this is a valid calendar object. Returns true if this is a valid calendar object.

View File

@ -217,7 +217,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
This class includes data obtained from the CLDR data files under the terms This class includes data obtained from the CLDR data files under the terms
of the Unicode Data Files and Software License. See of the Unicode Data Files and Software License. See
\l{Unicode Common Locale Data Repository (CLDR)} for details. \l{unicode-cldr}{Unicode Common Locale Data Repository (CLDR)} for details.
\sa QDateTime \sa QDateTime
*/ */

View File

@ -696,7 +696,7 @@ void QDBusAbstractInterface::internalPropSet(const char *propname, const QVarian
*/ */
/*! /*!
\fn QDBusAbstractInterface::call(const QString &message, Args&&...args) \fn template <typename...Args> QDBusMessage QDBusAbstractInterface::call(const QString &method, Args&&...args)
Calls the method \a method on this interface and passes \a args to the method. Calls the method \a method on this interface and passes \a args to the method.
All \a args must be convertible to QVariant. All \a args must be convertible to QVariant.
@ -745,7 +745,7 @@ QDBusMessage QDBusAbstractInterface::call(const QString &method, const QVariant
*/ */
/*! /*!
\fn QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &message, Args&&...args) \fn template <typename...Args> QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &method, Args&&...args)
\overload \overload
@ -827,7 +827,7 @@ QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &m
*/ */
/*! /*!
\fn QDBusAbstractInterface::asyncCall(const QString &message, Args&&...args) \fn template <typename...Args> QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, Args&&...args)
Calls the method \a method on this interface and passes \a args to the method. Calls the method \a method on this interface and passes \a args to the method.
All \a args must be convertible to QVariant. All \a args must be convertible to QVariant.

View File

@ -82,8 +82,7 @@ QT_BEGIN_NAMESPACE
provide a method of detaching the copies (since they refer provide a method of detaching the copies (since they refer
to the same pending call) to the same pending call)
\sa QDBusPendingReply, QDBusPendingCallWatcher, \sa QDBusPendingReply, QDBusPendingCallWatcher
QDBusAbstractInterface::asyncCall()
*/ */
/*! /*!
@ -115,7 +114,7 @@ QT_BEGIN_NAMESPACE
(one string and one QByteArray), QDBusPendingReply::isError() will (one string and one QByteArray), QDBusPendingReply::isError() will
return true. return true.
\sa QDBusPendingReply, QDBusAbstractInterface::asyncCall() \sa QDBusPendingReply
*/ */
/*! /*!

View File

@ -91,8 +91,7 @@
QDBusPendingCallWatcher objects, which emit signals when the reply QDBusPendingCallWatcher objects, which emit signals when the reply
arrives. arrives.
\sa QDBusPendingCallWatcher, QDBusReply, \sa QDBusPendingCallWatcher, QDBusReply
QDBusAbstractInterface::asyncCall()
*/ */
/*! /*!

View File

@ -41,6 +41,7 @@ depends += \
qtwidgets \ qtwidgets \
qtdoc \ qtdoc \
qmake \ qmake \
qtcmake \
qttestlib qttestlib
headerdirs += .. headerdirs += ..

View File

@ -2690,7 +2690,6 @@ QOpenGLContext *QWindowPrivate::shareContext() const
platform dependent and untested. platform dependent and untested.
\sa setParent() \sa setParent()
\sa setTransientParent()
*/ */
QWindow *QWindow::fromWinId(WId id) QWindow *QWindow::fromWinId(WId id)
{ {

View File

@ -220,8 +220,6 @@ static bool isRasterSurface(QWindow *window)
to the backingstore's top level window. to the backingstore's top level window.
You should call this function after ending painting with endPaint(). You should call this function after ending painting with endPaint().
\sa QWindow::transientParent()
*/ */
void QBackingStore::flush(const QRegion &region, QWindow *window, const QPoint &offset) void QBackingStore::flush(const QRegion &region, QWindow *window, const QPoint &offset)
{ {

View File

@ -72,10 +72,10 @@ public:
QColor(Qt::GlobalColor color) noexcept; QColor(Qt::GlobalColor color) noexcept;
Q_DECL_CONSTEXPR QColor(int r, int g, int b, int a = 255) noexcept Q_DECL_CONSTEXPR QColor(int r, int g, int b, int a = 255) noexcept
: cspec(isRgbaValid(r, g, b, a) ? Rgb : Invalid), : cspec(isRgbaValid(r, g, b, a) ? Rgb : Invalid),
ct(cspec == Rgb ? a * 0x0101 : 0, ct(ushort(cspec == Rgb ? a * 0x0101 : 0),
cspec == Rgb ? r * 0x0101 : 0, ushort(cspec == Rgb ? r * 0x0101 : 0),
cspec == Rgb ? g * 0x0101 : 0, ushort(cspec == Rgb ? g * 0x0101 : 0),
cspec == Rgb ? b * 0x0101 : 0, ushort(cspec == Rgb ? b * 0x0101 : 0),
0) {} 0) {}
QColor(QRgb rgb) noexcept; QColor(QRgb rgb) noexcept;
QColor(QRgba64 rgba64) noexcept; QColor(QRgba64 rgba64) noexcept;

View File

@ -1404,8 +1404,7 @@ void QPainterPrivate::updateState(QPainterState *newState)
cases where expensive operations are ok to use, for instance when cases where expensive operations are ok to use, for instance when
the result is cached in a QPixmap. the result is cached in a QPixmap.
\sa QPaintDevice, QPaintEngine, {Qt SVG}, {Basic Drawing Example}, \sa QPaintDevice, QPaintEngine, {Qt SVG}, {Basic Drawing Example}, {<qdrawutil.h>}{Drawing Utility Functions}
{Drawing Utility Functions}
*/ */
/*! /*!

View File

@ -122,7 +122,7 @@ QT_BEGIN_NAMESPACE
recording a frame, that is, between a \l{QRhi::beginFrame()}{beginFrame()} recording a frame, that is, between a \l{QRhi::beginFrame()}{beginFrame()}
- \l{QRhi::endFrame()}{endFrame()} or - \l{QRhi::endFrame()}{endFrame()} or
\l{QRhi::beginOffscreenFrame()}{beginOffscreenFrame()} - \l{QRhi::beginOffscreenFrame()}{beginOffscreenFrame()} -
\l{QRhi::endOffsrceenFrame()}{endOffscreenFrame()} pair. \l{QRhi::endOffscreenFrame()}{endOffsrceenFrame()} pair.
\note The command encoder is only valid while recording a pass, that is, \note The command encoder is only valid while recording a pass, that is,
between \l{QRhiCommandBuffer::beginPass()} - between \l{QRhiCommandBuffer::beginPass()} -

View File

@ -106,12 +106,12 @@ extern void qt_format_text(const QFont& font, const QRectF &_r,
These are by necessity slow, and we recommend avoiding them if These are by necessity slow, and we recommend avoiding them if
possible. possible.
For each character, you can get its width(), leftBearing() and For each character, you can get its horizontalAdvance(), leftBearing(),
rightBearing() and find out whether it is in the font using and rightBearing(), and find out whether it is in the font using
inFont(). You can also treat the character as a string, and use inFont(). You can also treat the character as a string, and use
the string functions on it. the string functions on it.
The string functions include width(), to return the width of a The string functions include horizontalAdvance(), to return the width of a
string in pixels (or points, for a printer), boundingRect(), to string in pixels (or points, for a printer), boundingRect(), to
return a rectangle large enough to contain the rendered string, return a rectangle large enough to contain the rendered string,
and size(), to return the size of that rectangle. and size(), to return the size of that rectangle.
@ -464,9 +464,9 @@ bool QFontMetrics::inFontUcs4(uint ucs4) const
value is negative if the pixels of the character extend to the value is negative if the pixels of the character extend to the
left of the logical origin. left of the logical origin.
See width() for a graphical description of this metric. See horizontalAdvance() for a graphical description of this metric.
\sa rightBearing(), minLeftBearing(), width() \sa rightBearing(), minLeftBearing(), horizontalAdvance()
*/ */
int QFontMetrics::leftBearing(QChar ch) const int QFontMetrics::leftBearing(QChar ch) const
{ {
@ -495,11 +495,11 @@ int QFontMetrics::leftBearing(QChar ch) const
The right bearing is the left-ward distance of the right-most The right bearing is the left-ward distance of the right-most
pixel of the character from the logical origin of a subsequent pixel of the character from the logical origin of a subsequent
character. This value is negative if the pixels of the character character. This value is negative if the pixels of the character
extend to the right of the width() of the character. extend to the right of the horizontalAdvance() of the character.
See width() for a graphical description of this metric. See horizontalAdvance() for a graphical description of this metric.
\sa leftBearing(), minRightBearing(), width() \sa leftBearing(), minRightBearing(), horizontalAdvance()
*/ */
int QFontMetrics::rightBearing(QChar ch) const int QFontMetrics::rightBearing(QChar ch) const
{ {
@ -535,7 +535,7 @@ int QFontMetrics::rightBearing(QChar ch) const
\deprecated in Qt 5.11. Use horizontalAdvance() instead. \deprecated in Qt 5.11. Use horizontalAdvance() instead.
\sa boundingRect() \sa boundingRect(), horizontalAdvance()
*/ */
int QFontMetrics::width(const QString &text, int len) const int QFontMetrics::width(const QString &text, int len) const
{ {
@ -601,7 +601,7 @@ int QFontMetrics::width(const QString &text, int len, int flags) const
processing strings cannot be taken into account. When implementing processing strings cannot be taken into account. When implementing
an interactive text control, use QTextLayout instead. an interactive text control, use QTextLayout instead.
\sa boundingRect() \sa boundingRect(), horizontalAdvance()
*/ */
int QFontMetrics::width(QChar ch) const int QFontMetrics::width(QChar ch) const
{ {
@ -751,7 +751,8 @@ int QFontMetrics::charWidth(const QString &text, int pos) const
Note that the bounding rectangle may extend to the left of (0, 0), Note that the bounding rectangle may extend to the left of (0, 0),
e.g. for italicized fonts, and that the width of the returned e.g. for italicized fonts, and that the width of the returned
rectangle might be different than what the width() method returns. rectangle might be different than what the horizontalAdvance() method
returns.
If you want to know the advance width of the string (to lay out If you want to know the advance width of the string (to lay out
a set of strings next to each other), use horizontalAdvance() instead. a set of strings next to each other), use horizontalAdvance() instead.
@ -762,7 +763,8 @@ int QFontMetrics::charWidth(const QString &text, int pos) const
The height of the bounding rectangle is at least as large as the The height of the bounding rectangle is at least as large as the
value returned by height(). value returned by height().
\sa width(), height(), QPainter::boundingRect(), tightBoundingRect() \sa horizontalAdvance(), height(), QPainter::boundingRect(),
tightBoundingRect()
*/ */
QRect QFontMetrics::boundingRect(const QString &text) const QRect QFontMetrics::boundingRect(const QString &text) const
{ {
@ -790,7 +792,7 @@ QRect QFontMetrics::boundingRect(const QString &text) const
\warning The width of the returned rectangle is not the advance width \warning The width of the returned rectangle is not the advance width
of the character. Use boundingRect(const QString &) or horizontalAdvance() instead. of the character. Use boundingRect(const QString &) or horizontalAdvance() instead.
\sa width() \sa horizontalAdvance()
*/ */
QRect QFontMetrics::boundingRect(QChar ch) const QRect QFontMetrics::boundingRect(QChar ch) const
{ {
@ -864,7 +866,7 @@ QRect QFontMetrics::boundingRect(QChar ch) const
fontHeight() and lineSpacing() are used to calculate the height, fontHeight() and lineSpacing() are used to calculate the height,
rather than individual character heights. rather than individual character heights.
\sa width(), QPainter::boundingRect(), Qt::Alignment \sa horizontalAdvance(), QPainter::boundingRect(), Qt::Alignment
*/ */
QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &text, int tabStops, QRect QFontMetrics::boundingRect(const QRect &rect, int flags, const QString &text, int tabStops,
int *tabArray) const int *tabArray) const
@ -920,7 +922,8 @@ QSize QFontMetrics::size(int flags, const QString &text, int tabStops, int *tabA
Note that the bounding rectangle may extend to the left of (0, 0), Note that the bounding rectangle may extend to the left of (0, 0),
e.g. for italicized fonts, and that the width of the returned e.g. for italicized fonts, and that the width of the returned
rectangle might be different than what the width() method returns. rectangle might be different than what the horizontalAdvance() method
returns.
If you want to know the advance width of the string (to lay out If you want to know the advance width of the string (to lay out
a set of strings next to each other), use horizontalAdvance() instead. a set of strings next to each other), use horizontalAdvance() instead.
@ -930,7 +933,7 @@ QSize QFontMetrics::size(int flags, const QString &text, int tabStops, int *tabA
\warning Calling this method is very slow on Windows. \warning Calling this method is very slow on Windows.
\sa width(), height(), boundingRect() \sa horizontalAdvance(), height(), boundingRect()
*/ */
QRect QFontMetrics::tightBoundingRect(const QString &text) const QRect QFontMetrics::tightBoundingRect(const QString &text) const
{ {
@ -1079,12 +1082,12 @@ qreal QFontMetrics::fontDpi() const
These are by necessity slow, and we recommend avoiding them if These are by necessity slow, and we recommend avoiding them if
possible. possible.
For each character, you can get its width(), leftBearing() and For each character, you can get its horizontalAdvance(), leftBearing(), and
rightBearing() and find out whether it is in the font using rightBearing(), and find out whether it is in the font using
inFont(). You can also treat the character as a string, and use inFont(). You can also treat the character as a string, and use
the string functions on it. the string functions on it.
The string functions include width(), to return the width of a The string functions include horizontalAdvance(), to return the width of a
string in pixels (or points, for a printer), boundingRect(), to string in pixels (or points, for a printer), boundingRect(), to
return a rectangle large enough to contain the rendered string, return a rectangle large enough to contain the rendered string,
and size(), to return the size of that rectangle. and size(), to return the size of that rectangle.
@ -1434,9 +1437,9 @@ bool QFontMetricsF::inFontUcs4(uint ucs4) const
value is negative if the pixels of the character extend to the value is negative if the pixels of the character extend to the
left of the logical origin. left of the logical origin.
See width() for a graphical description of this metric. See horizontalAdvance() for a graphical description of this metric.
\sa rightBearing(), minLeftBearing(), width() \sa rightBearing(), minLeftBearing(), horizontalAdvance()
*/ */
qreal QFontMetricsF::leftBearing(QChar ch) const qreal QFontMetricsF::leftBearing(QChar ch) const
{ {
@ -1465,11 +1468,11 @@ qreal QFontMetricsF::leftBearing(QChar ch) const
The right bearing is the left-ward distance of the right-most The right bearing is the left-ward distance of the right-most
pixel of the character from the logical origin of a subsequent pixel of the character from the logical origin of a subsequent
character. This value is negative if the pixels of the character character. This value is negative if the pixels of the character
extend to the right of the width() of the character. extend to the right of the horizontalAdvance() of the character.
See width() for a graphical description of this metric. See horizontalAdvance() for a graphical description of this metric.
\sa leftBearing(), minRightBearing(), width() \sa leftBearing(), minRightBearing(), horizontalAdvance()
*/ */
qreal QFontMetricsF::rightBearing(QChar ch) const qreal QFontMetricsF::rightBearing(QChar ch) const
{ {
@ -1504,7 +1507,7 @@ qreal QFontMetricsF::rightBearing(QChar ch) const
\deprecated in Qt 5.11. Use horizontalAdvance() instead. \deprecated in Qt 5.11. Use horizontalAdvance() instead.
\sa boundingRect() \sa boundingRect(), horizontalAdvance()
*/ */
qreal QFontMetricsF::width(const QString &text) const qreal QFontMetricsF::width(const QString &text) const
{ {
@ -1535,7 +1538,7 @@ qreal QFontMetricsF::width(const QString &text) const
processing strings cannot be taken into account. When implementing processing strings cannot be taken into account. When implementing
an interactive text control, use QTextLayout instead. an interactive text control, use QTextLayout instead.
\sa boundingRect() \sa boundingRect(), horizontalAdvance()
*/ */
qreal QFontMetricsF::width(QChar ch) const qreal QFontMetricsF::width(QChar ch) const
{ {
@ -1581,7 +1584,7 @@ qreal QFontMetricsF::horizontalAdvance(const QString &text, int length) const
ch. ch.
Some of the metrics are described in the image to the right. The Some of the metrics are described in the image to the right. The
central dark rectangles cover the logical width() of each central dark rectangles cover the logical horizontalAdvance() of each
character. The outer pale rectangles cover the leftBearing() and character. The outer pale rectangles cover the leftBearing() and
rightBearing() of each character. Notice that the bearings of "f" rightBearing() of each character. Notice that the bearings of "f"
in this particular font are both negative, while the bearings of in this particular font are both negative, while the bearings of
@ -1632,7 +1635,7 @@ qreal QFontMetricsF::horizontalAdvance(QChar ch) const
Note that the bounding rectangle may extend to the left of (0, 0), Note that the bounding rectangle may extend to the left of (0, 0),
e.g. for italicized fonts, and that the width of the returned e.g. for italicized fonts, and that the width of the returned
rectangle might be different than what the width() method returns. rectangle might be different than what the horizontalAdvance() method returns.
If you want to know the advance width of the string (to lay out If you want to know the advance width of the string (to lay out
a set of strings next to each other), use horizontalAdvance() instead. a set of strings next to each other), use horizontalAdvance() instead.
@ -1643,7 +1646,7 @@ qreal QFontMetricsF::horizontalAdvance(QChar ch) const
The height of the bounding rectangle is at least as large as the The height of the bounding rectangle is at least as large as the
value returned height(). value returned height().
\sa width(), height(), QPainter::boundingRect() \sa horizontalAdvance(), height(), QPainter::boundingRect()
*/ */
QRectF QFontMetricsF::boundingRect(const QString &text) const QRectF QFontMetricsF::boundingRect(const QString &text) const
{ {
@ -1669,7 +1672,7 @@ QRectF QFontMetricsF::boundingRect(const QString &text) const
Note that the rectangle usually extends both above and below the Note that the rectangle usually extends both above and below the
base line. base line.
\sa width() \sa horizontalAdvance()
*/ */
QRectF QFontMetricsF::boundingRect(QChar ch) const QRectF QFontMetricsF::boundingRect(QChar ch) const
{ {
@ -1746,7 +1749,7 @@ QRectF QFontMetricsF::boundingRect(QChar ch) const
fontHeight() and lineSpacing() are used to calculate the height, fontHeight() and lineSpacing() are used to calculate the height,
rather than individual character heights. rather than individual character heights.
\sa width(), QPainter::boundingRect(), Qt::Alignment \sa horizontalAdvance(), QPainter::boundingRect(), Qt::Alignment
*/ */
QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString& text, QRectF QFontMetricsF::boundingRect(const QRectF &rect, int flags, const QString& text,
int tabStops, int *tabArray) const int tabStops, int *tabArray) const
@ -1805,7 +1808,8 @@ QSizeF QFontMetricsF::size(int flags, const QString &text, int tabStops, int *ta
Note that the bounding rectangle may extend to the left of (0, 0), Note that the bounding rectangle may extend to the left of (0, 0),
e.g. for italicized fonts, and that the width of the returned e.g. for italicized fonts, and that the width of the returned
rectangle might be different than what the width() method returns. rectangle might be different than what the horizontalAdvance() method
returns.
If you want to know the advance width of the string (to lay out If you want to know the advance width of the string (to lay out
a set of strings next to each other), use horizontalAdvance() instead. a set of strings next to each other), use horizontalAdvance() instead.
@ -1815,7 +1819,7 @@ QSizeF QFontMetricsF::size(int flags, const QString &text, int tabStops, int *ta
\warning Calling this method is very slow on Windows. \warning Calling this method is very slow on Windows.
\sa width(), height(), boundingRect() \sa horizontalAdvance(), height(), boundingRect()
*/ */
QRectF QFontMetricsF::tightBoundingRect(const QString &text) const QRectF QFontMetricsF::tightBoundingRect(const QString &text) const
{ {

View File

@ -28,6 +28,7 @@
/*! /*!
\class QWindowsWindowFunctions \class QWindowsWindowFunctions
\inmodule QtPlatformHeaders \inmodule QtPlatformHeaders
\inheaderfile QtPlatformHeaders/QWindowsWindowFunctions
\since 5.5 \since 5.5
\brief The QWindowsWindowFunctions class is an inline class containing \brief The QWindowsWindowFunctions class is an inline class containing
miscellaneous functionality for Windows window specific functionality. miscellaneous functionality for Windows window specific functionality.

View File

@ -755,6 +755,12 @@ void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button
\sa QDialogButtonBox, {fowler}{GUI Design Handbook: Message Box}, {Standard Dialogs Example}, {Application Example} \sa QDialogButtonBox, {fowler}{GUI Design Handbook: Message Box}, {Standard Dialogs Example}, {Application Example}
*/ */
/*!
\enum QMessageBox::ButtonRole
\include qdialogbuttonbox.cpp buttonrole-enum
*/
/*! /*!
\enum QMessageBox::StandardButton \enum QMessageBox::StandardButton
\since 4.2 \since 4.2

View File

@ -923,8 +923,8 @@ QTableWidgetSelectionRange::QTableWidgetSelectionRange(int top, int left, int bo
Constructs a the table selection range by copying the given \a Constructs a the table selection range by copying the given \a
other table selection range. other table selection range.
*/ */
QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other) = default; QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &) = default;
QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &other) = default; QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &) = default;
/*! /*!
Destroys the table selection range. Destroys the table selection range.

View File

@ -522,8 +522,8 @@ QDialogButtonBox::~QDialogButtonBox()
/*! /*!
\enum QDialogButtonBox::ButtonRole \enum QDialogButtonBox::ButtonRole
\enum QMessageBox::ButtonRole
//! [buttonrole-enum]
This enum describes the roles that can be used to describe buttons in This enum describes the roles that can be used to describe buttons in
the button box. Combinations of these roles are as flags used to the button box. Combinations of these roles are as flags used to
describe different aspects of their behavior. describe different aspects of their behavior.
@ -546,6 +546,7 @@ QDialogButtonBox::~QDialogButtonBox()
\omitvalue NRoles \omitvalue NRoles
\sa StandardButton \sa StandardButton
//! [buttonrole-enum]
*/ */
/*! /*!