From 9f1948f59b916966ea0ecdf9c7d3473f7685e08e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 15 Jan 2020 21:04:17 +0100 Subject: QRegularExpression: fixup docs of wildcardToRegularExpression Fix a couple of typos, and add a paragraph explaining that there is no need of anchor the pattern again; a wildcard is always anchored. Fixes: QTBUG-81396 Change-Id: Ia67dc7477a05a450bdcc3def1ebbacce2006da4d Reviewed-by: Thiago Macieira --- src/corelib/text/qregularexpression.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp index 67be67c243..59d21e0a23 100644 --- a/src/corelib/text/qregularexpression.cpp +++ b/src/corelib/text/qregularexpression.cpp @@ -1892,6 +1892,10 @@ QString QRegularExpression::escape(const QString &str) \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 of wildcard for glob patterns: \table @@ -1918,12 +1922,12 @@ QString QRegularExpression::escape(const QString &str) \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 - (for example, "[?]"). + (for example, \c{[?]}). More information about the implementation can be found in: \list \li \l {https://en.wikipedia.org/wiki/Glob_(programming)} {The Wikipedia Glob article} - \li \c man 7 glob + \li \c {man 7 glob} \endlist \sa escape() -- cgit v1.2.3 From c0ea88a6776b6281d5774d03572b1aecc2ef3c25 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 6 Jan 2020 17:47:41 +0100 Subject: Fix MS-Win system locale code to return QString for numeric tokens QSystemLocale::query() is specified to return a QString (wrapped in a QVariant) for the various tokens used in formatting numbers (zero digit, signs, separators) but the MS-Win back-end was returning QChar (wrapped as QVariant) instead, using the first UCS-2 code-point of the string (even if this was the first of a surrogate pair). The same error shall be perpetrated by its caller, but we can at least DTRT in the back-end, ready for the coming fix (in Qt 6) to its caller. In the process, eliminate some local variables that shadowed a member variable and adapt number-conversion to cope with surrogate-pair digits. Optimised the latter for the case where zero is "0". Change-Id: Idfb416c301add4c961dde613b3dc28b2e31fd0af Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale_win.cpp | 97 +++++++++++++++++++++++++--------------- 1 file changed, 62 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index 79ea67f966..4b4152c519 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -106,11 +106,11 @@ struct QSystemLocalePrivate { QSystemLocalePrivate(); - QChar zeroDigit(); - QChar decimalPoint(); - QChar groupSeparator(); - QChar negativeSign(); - QChar positiveSign(); + QString zeroDigit(); + QString decimalPoint(); + QString groupSeparator(); + QString negativeSign(); + QString positiveSign(); QVariant dateFormat(QLocale::FormatType); QVariant timeFormat(QLocale::FormatType); QVariant dateTimeFormat(QLocale::FormatType); @@ -147,12 +147,11 @@ private: WCHAR lcName[LOCALE_NAME_MAX_LENGTH]; #endif SubstitutionType substitutionType; - QChar zero; + QString zero; // cached value for zeroDigit() int getLocaleInfo(LCTYPE type, LPWSTR data, int size); QString getLocaleInfo(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 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; } -QChar QSystemLocalePrivate::getLocaleInfo_qchar(LCTYPE type) -{ - QString str = getLocaleInfo(type); - return str.isEmpty() ? QChar() : str.at(0); -} - QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution() { if (substitutionType == SUnknown) { @@ -257,13 +250,12 @@ QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution() else if (buf[0] == '2') substitutionType = QSystemLocalePrivate::SAlways; else { - wchar_t digits[11]; + wchar_t digits[11]; // See zeroDigit() for why 11. if (!getLocaleInfo(LOCALE_SNATIVEDIGITS, digits, 11)) { substitutionType = QSystemLocalePrivate::SNever; return substitutionType; } - const wchar_t zero = digits[0]; - if (buf[0] == zero + 2) + if (buf[0] == digits[0] + 2) substitutionType = QSystemLocalePrivate::SAlways; else substitutionType = QSystemLocalePrivate::SNever; @@ -274,40 +266,75 @@ QSystemLocalePrivate::SubstitutionType QSystemLocalePrivate::substitution() QString &QSystemLocalePrivate::substituteDigits(QString &string) { - ushort zero = zeroDigit().unicode(); - ushort *qch = reinterpret_cast(string.data()); - for (ushort *end = qch + string.size(); qch != end; ++qch) { - if (*qch >= '0' && *qch <= '9') - *qch = zero + (*qch - '0'); + zeroDigit(); // Ensure zero is set. + switch (zero.size()) { + case 1: { + const ushort offset = zero.at(0).unicode() - '0'; + if (!offset) // Nothing to do + break; + Q_ASSERT(offset > 9); + ushort *const qch = reinterpret_cast(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; } -QChar QSystemLocalePrivate::zeroDigit() +QString QSystemLocalePrivate::zeroDigit() { - if (zero.isNull()) - zero = getLocaleInfo_qchar(LOCALE_SNATIVEDIGITS); + if (zero.isEmpty()) { + /* 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; } -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) @@ -677,7 +704,7 @@ void QSystemLocalePrivate::update() GetUserDefaultLocaleName(lcName, LOCALE_NAME_MAX_LENGTH); #endif substitutionType = SUnknown; - zero = QChar(); + zero.resize(0); } QString QSystemLocalePrivate::winToQtFormat(QStringView sys_fmt) @@ -749,7 +776,7 @@ QLocale QSystemLocale::fallbackUiLocale() const 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(); switch(type) { -- cgit v1.2.3 From 5dc16d132497b54af608126ecf92f9e064c5aaf1 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 2 Oct 2019 00:03:18 +0200 Subject: Doc: Fix ButtonRole enum docs for QMessageBox and QDialogButtonBox Multiple topic commands (in this case, \enum) do not work across different classes. Reuse the documentation comment via an \include statement instead. Fixes: QTBUG-78910 Change-Id: Ife83bdc9bbad650835fafc072180d10037648d0a Reviewed-by: Paul Wicking --- src/widgets/dialogs/qmessagebox.cpp | 6 ++++++ src/widgets/widgets/qdialogbuttonbox.cpp | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index e20657a0f6..e1cc475a93 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -755,6 +755,12 @@ void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button \sa QDialogButtonBox, {fowler}{GUI Design Handbook: Message Box}, {Standard Dialogs Example}, {Application Example} */ +/*! + \enum QMessageBox::ButtonRole + + \include qdialogbuttonbox.cpp buttonrole-enum +*/ + /*! \enum QMessageBox::StandardButton \since 4.2 diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index 28f6cdc7bd..7dba6df15c 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -522,8 +522,8 @@ QDialogButtonBox::~QDialogButtonBox() /*! \enum QDialogButtonBox::ButtonRole - \enum QMessageBox::ButtonRole +//! [buttonrole-enum] 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 describe different aspects of their behavior. @@ -546,6 +546,7 @@ QDialogButtonBox::~QDialogButtonBox() \omitvalue NRoles \sa StandardButton +//! [buttonrole-enum] */ /*! -- cgit v1.2.3 From a3b2eac380bcd7d787e8fcc92a27bd7ed4f80b55 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Thu, 16 Jan 2020 11:18:21 +0100 Subject: QColor: add casts to ushort Silence lossy conversion warnings on MSVC. Task-number: QTBUG-80997 Change-Id: I0e5778b9f20b599de6fc8894c4b98fbc1b1510b9 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qcolor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h index f0d7dd23ad..0189f4e5f1 100644 --- a/src/gui/painting/qcolor.h +++ b/src/gui/painting/qcolor.h @@ -72,10 +72,10 @@ public: QColor(Qt::GlobalColor color) noexcept; Q_DECL_CONSTEXPR QColor(int r, int g, int b, int a = 255) noexcept : cspec(isRgbaValid(r, g, b, a) ? Rgb : Invalid), - ct(cspec == Rgb ? a * 0x0101 : 0, - cspec == Rgb ? r * 0x0101 : 0, - cspec == Rgb ? g * 0x0101 : 0, - cspec == Rgb ? b * 0x0101 : 0, + ct(ushort(cspec == Rgb ? a * 0x0101 : 0), + ushort(cspec == Rgb ? r * 0x0101 : 0), + ushort(cspec == Rgb ? g * 0x0101 : 0), + ushort(cspec == Rgb ? b * 0x0101 : 0), 0) {} QColor(QRgb rgb) noexcept; QColor(QRgba64 rgba64) noexcept; -- cgit v1.2.3 From 89312b2eabc86a9de6892778a458b914c9b2b72c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 16 Jan 2020 16:31:36 +0100 Subject: Remove unused parameters from default-synthesized members Fixes build error with gcc when compiled with -Werror=unused-parameters. Change-Id: I12c3ecb30f489986b112f9736caec40aa50c7283 Fixes: QTBUG-81465 Reviewed-by: Liang Qi --- src/widgets/itemviews/qtablewidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp index b1dbafa997..9134abe270 100644 --- a/src/widgets/itemviews/qtablewidget.cpp +++ b/src/widgets/itemviews/qtablewidget.cpp @@ -923,8 +923,8 @@ QTableWidgetSelectionRange::QTableWidgetSelectionRange(int top, int left, int bo Constructs a the table selection range by copying the given \a other table selection range. */ -QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other) = default; -QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &other) = default; +QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &) = default; +QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &) = default; /*! Destroys the table selection range. -- cgit v1.2.3 From 28f95d4688c28f8c06aa103012c6a00e197db12c Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Wed, 15 Jan 2020 14:38:14 +0100 Subject: Doc: Fix qdoc compilation errors qtbase Task-number: QTBUG-79824 Change-Id: I5a39525e3e735415ba96e2d585c5de754deb15de Reviewed-by: Venugopal Shivashankar --- src/corelib/doc/qtcore.qdocconf | 2 +- src/corelib/doc/src/qtcore-index.qdoc | 2 +- src/corelib/global/qendian.cpp | 1 - src/corelib/time/qcalendar.cpp | 2 +- src/corelib/time/qtimezone.cpp | 2 +- src/dbus/qdbusabstractinterface.cpp | 6 +++--- src/dbus/qdbuspendingcall.cpp | 5 ++--- src/dbus/qdbuspendingreply.cpp | 3 +-- src/gui/doc/qtgui.qdocconf | 1 + src/gui/kernel/qwindow.cpp | 1 - src/gui/painting/qbackingstore.cpp | 2 -- src/gui/painting/qpainter.cpp | 3 +-- src/gui/rhi/qrhimetal.mm | 2 +- 13 files changed, 13 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index 15b1925e51..2b9adabc3a 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true 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 += .. diff --git a/src/corelib/doc/src/qtcore-index.qdoc b/src/corelib/doc/src/qtcore-index.qdoc index 29fc25f69d..5838d13914 100644 --- a/src/corelib/doc/src/qtcore-index.qdoc +++ b/src/corelib/doc/src/qtcore-index.qdoc @@ -56,7 +56,7 @@ \include module-use.qdocinc using qt module \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 diff --git a/src/corelib/global/qendian.cpp b/src/corelib/global/qendian.cpp index 98dc6a9a4b..eb08b2f848 100644 --- a/src/corelib/global/qendian.cpp +++ b/src/corelib/global/qendian.cpp @@ -192,7 +192,6 @@ QT_BEGIN_NAMESPACE an in-place swap (if necessary). If they are not the same, the memory regions must not overlap. - \sa qFromLittleEndian() \sa qToBigEndian() \sa qToLittleEndian() */ diff --git a/src/corelib/time/qcalendar.cpp b/src/corelib/time/qcalendar.cpp index 6a4623ce92..9d485f181e 100644 --- a/src/corelib/time/qcalendar.cpp +++ b/src/corelib/time/qcalendar.cpp @@ -723,7 +723,7 @@ QCalendar::QCalendar(QLatin1String name) QCalendar::QCalendar(QStringView name) : d(QCalendarBackend::fromName(name)) {} -/* +/*! \fn bool QCalendar::isValid() const Returns true if this is a valid calendar object. diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp index ef323de14a..0bba2afc61 100644 --- a/src/corelib/time/qtimezone.cpp +++ b/src/corelib/time/qtimezone.cpp @@ -217,7 +217,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz); This class includes data obtained from the CLDR data files under the terms 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 */ diff --git a/src/dbus/qdbusabstractinterface.cpp b/src/dbus/qdbusabstractinterface.cpp index 87de784fc0..d15496a792 100644 --- a/src/dbus/qdbusabstractinterface.cpp +++ b/src/dbus/qdbusabstractinterface.cpp @@ -696,7 +696,7 @@ void QDBusAbstractInterface::internalPropSet(const char *propname, const QVarian */ /*! - \fn QDBusAbstractInterface::call(const QString &message, Args&&...args) + \fn template QDBusMessage QDBusAbstractInterface::call(const QString &method, Args&&...args) Calls the method \a method on this interface and passes \a args to the method. 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 QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &method, Args&&...args) \overload @@ -827,7 +827,7 @@ QDBusMessage QDBusAbstractInterface::call(QDBus::CallMode mode, const QString &m */ /*! - \fn QDBusAbstractInterface::asyncCall(const QString &message, Args&&...args) + \fn template QDBusPendingCall QDBusAbstractInterface::asyncCall(const QString &method, Args&&...args) Calls the method \a method on this interface and passes \a args to the method. All \a args must be convertible to QVariant. diff --git a/src/dbus/qdbuspendingcall.cpp b/src/dbus/qdbuspendingcall.cpp index 8e604d5a77..eeb9c266a3 100644 --- a/src/dbus/qdbuspendingcall.cpp +++ b/src/dbus/qdbuspendingcall.cpp @@ -82,8 +82,7 @@ QT_BEGIN_NAMESPACE provide a method of detaching the copies (since they refer to the same pending call) - \sa QDBusPendingReply, QDBusPendingCallWatcher, - QDBusAbstractInterface::asyncCall() + \sa QDBusPendingReply, QDBusPendingCallWatcher */ /*! @@ -115,7 +114,7 @@ QT_BEGIN_NAMESPACE (one string and one QByteArray), QDBusPendingReply::isError() will return true. - \sa QDBusPendingReply, QDBusAbstractInterface::asyncCall() + \sa QDBusPendingReply */ /*! diff --git a/src/dbus/qdbuspendingreply.cpp b/src/dbus/qdbuspendingreply.cpp index ec49bafb60..b1b5fb3431 100644 --- a/src/dbus/qdbuspendingreply.cpp +++ b/src/dbus/qdbuspendingreply.cpp @@ -91,8 +91,7 @@ QDBusPendingCallWatcher objects, which emit signals when the reply arrives. - \sa QDBusPendingCallWatcher, QDBusReply, - QDBusAbstractInterface::asyncCall() + \sa QDBusPendingCallWatcher, QDBusReply */ /*! diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index 76dd6d7ea1..d149caf069 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -41,6 +41,7 @@ depends += \ qtwidgets \ qtdoc \ qmake \ + qtcmake \ qttestlib headerdirs += .. diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index f701755500..0a4277c118 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2690,7 +2690,6 @@ QOpenGLContext *QWindowPrivate::shareContext() const platform dependent and untested. \sa setParent() - \sa setTransientParent() */ QWindow *QWindow::fromWinId(WId id) { diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index b0393aff95..0a49269c36 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -220,8 +220,6 @@ static bool isRasterSurface(QWindow *window) to the backingstore's top level window. You should call this function after ending painting with endPaint(). - - \sa QWindow::transientParent() */ void QBackingStore::flush(const QRegion ®ion, QWindow *window, const QPoint &offset) { diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 3ce54c20be..75e7dc49fd 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -1404,8 +1404,7 @@ void QPainterPrivate::updateState(QPainterState *newState) cases where expensive operations are ok to use, for instance when the result is cached in a QPixmap. - \sa QPaintDevice, QPaintEngine, {Qt SVG}, {Basic Drawing Example}, - {Drawing Utility Functions} + \sa QPaintDevice, QPaintEngine, {Qt SVG}, {Basic Drawing Example}, {}{Drawing Utility Functions} */ /*! diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index 3ecc56d147..83fec31081 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -129,7 +129,7 @@ QT_BEGIN_NAMESPACE recording a frame, that is, between a \l{QRhi::beginFrame()}{beginFrame()} - \l{QRhi::endFrame()}{endFrame()} or \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, between \l{QRhiCommandBuffer::beginPass()} - -- cgit v1.2.3 From fd31e4ce43be112b42ffb7624c02b1de62dabcf5 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Fri, 17 Jan 2020 13:02:25 +0100 Subject: Doc: Display correct include for QWindowsWindowFunctions Fixes: QTBUG-55412 Change-Id: I3a38fa26911b1c151af9f0b47f1be602058aa4af Reviewed-by: Venugopal Shivashankar --- src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc index 0c52cde753..31a8d40abe 100644 --- a/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc +++ b/src/platformheaders/windowsfunctions/qwindowswindowfunctions.qdoc @@ -28,6 +28,7 @@ /*! \class QWindowsWindowFunctions \inmodule QtPlatformHeaders + \inheaderfile QtPlatformHeaders/QWindowsWindowFunctions \since 5.5 \brief The QWindowsWindowFunctions class is an inline class containing miscellaneous functionality for Windows window specific functionality. -- cgit v1.2.3 From 9c172af7d5d8696a692fb2e040be11eae99a4b0c Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Mon, 23 Jul 2018 10:01:23 +0200 Subject: Doc: Update text that refers to deprecated member function width() * Add see also links from the deprecated function to the replacement. * Change introduction text to reflect new function name rather than the old and deprecated width(). * Change see also and inline references to width(), so that they now refer to horizontalAdvance(). Task-number: QTBUG-65141 Change-Id: Iadfbc517e5df96e32058516f8795bd210cc4c5e4 Reviewed-by: Nico Vertriest Reviewed-by: Venugopal Shivashankar --- src/gui/text/qfontmetrics.cpp | 70 +++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/gui/text/qfontmetrics.cpp b/src/gui/text/qfontmetrics.cpp index d3e4f11e8c..b7a3066f3a 100644 --- a/src/gui/text/qfontmetrics.cpp +++ b/src/gui/text/qfontmetrics.cpp @@ -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 possible. - For each character, you can get its width(), leftBearing() and - rightBearing() and find out whether it is in the font using + For each character, you can get its horizontalAdvance(), leftBearing(), + and rightBearing(), and find out whether it is in the font using inFont(). You can also treat the character as a string, and use 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 return a rectangle large enough to contain the rendered string, 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 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 { @@ -495,11 +495,11 @@ int QFontMetrics::leftBearing(QChar ch) const The right bearing is the left-ward distance of the right-most pixel of the character from the logical origin of a subsequent 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 { @@ -535,7 +535,7 @@ int QFontMetrics::rightBearing(QChar ch) const \deprecated in Qt 5.11. Use horizontalAdvance() instead. - \sa boundingRect() + \sa boundingRect(), horizontalAdvance() */ 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 an interactive text control, use QTextLayout instead. - \sa boundingRect() + \sa boundingRect(), horizontalAdvance() */ 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), 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 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 value returned by height(). - \sa width(), height(), QPainter::boundingRect(), tightBoundingRect() + \sa horizontalAdvance(), height(), QPainter::boundingRect(), + tightBoundingRect() */ 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 of the character. Use boundingRect(const QString &) or horizontalAdvance() instead. - \sa width() + \sa horizontalAdvance() */ 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, 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, 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), 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 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. - \sa width(), height(), boundingRect() + \sa horizontalAdvance(), height(), boundingRect() */ 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 possible. - For each character, you can get its width(), leftBearing() and - rightBearing() and find out whether it is in the font using + For each character, you can get its horizontalAdvance(), leftBearing(), and + rightBearing(), and find out whether it is in the font using inFont(). You can also treat the character as a string, and use 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 return a rectangle large enough to contain the rendered string, 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 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 { @@ -1465,11 +1468,11 @@ qreal QFontMetricsF::leftBearing(QChar ch) const The right bearing is the left-ward distance of the right-most pixel of the character from the logical origin of a subsequent 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 { @@ -1504,7 +1507,7 @@ qreal QFontMetricsF::rightBearing(QChar ch) const \deprecated in Qt 5.11. Use horizontalAdvance() instead. - \sa boundingRect() + \sa boundingRect(), horizontalAdvance() */ 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 an interactive text control, use QTextLayout instead. - \sa boundingRect() + \sa boundingRect(), horizontalAdvance() */ qreal QFontMetricsF::width(QChar ch) const { @@ -1581,7 +1584,7 @@ qreal QFontMetricsF::horizontalAdvance(const QString &text, int length) const ch. 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 rightBearing() of each character. Notice that the bearings of "f" 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), 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 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 value returned height(). - \sa width(), height(), QPainter::boundingRect() + \sa horizontalAdvance(), height(), QPainter::boundingRect() */ 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 base line. - \sa width() + \sa horizontalAdvance() */ 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, 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, 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), 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 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. - \sa width(), height(), boundingRect() + \sa horizontalAdvance(), height(), boundingRect() */ QRectF QFontMetricsF::tightBoundingRect(const QString &text) const { -- cgit v1.2.3