From db81129240d1198884b4197857ec5934a5dc33d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 20 Jan 2020 15:07:34 +0100 Subject: macOS: Remove doc references to the Carbon framework Change-Id: I4d496acfc3d810d6334baba99cd697168bef0b75 Reviewed-by: Timur Pocheptsov --- src/gui/kernel/qevent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 0706ae3e90..de60a66517 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1150,8 +1150,8 @@ QKeyEvent::~QKeyEvent() Note: The native scan code may be 0, even if the key event contains extended information. - Note: On Mac OS/X, this function is not useful, because there is no - way to get the scan code from Carbon or Cocoa. The function always + Note: On \macos, this function is not useful, because there is no + way to get the scan code from the system APIs. The function always returns 1 (or 0 in the case explained above). */ -- cgit v1.2.3 From 73d1476fb1397948a4d806bd921fce372bd8d63b Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 2 Dec 2019 17:54:48 +0100 Subject: Replace most use of QVariant::type and occurrences of QVariant::Type I made a clazy automated check that replaced the use of QVariant::Type by the equivalent in QMetaType. This has been deprecated since Qt 5.0, but many uses were not yet removed. In addition, there was some manual changes to fix the compilation errors. Adapted the Private API of QDateTimeParser and QMimeDataPrivate and adjust QDateTimeEdit and QSpinBox. QVariant(QVariant::Invalid) in qstylesheet made no sense. But note that in QVariant::save, we actually wanted to use the non-user type. In the SQL module, many changes were actually reverted because the API still expects QVarient::Type. Change-Id: I98c368490e4ee465ed3a3b63bda8b8eaa50ea67e Reviewed-by: Lars Knoll --- src/gui/kernel/qcursor.cpp | 2 +- src/gui/kernel/qguivariant.cpp | 62 ++++++++++++++++++------------------ src/gui/kernel/qinternalmimedata.cpp | 13 ++++---- src/gui/kernel/qkeysequence.cpp | 2 +- src/gui/kernel/qpalette.cpp | 2 +- 5 files changed, 41 insertions(+), 40 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index f5a794b642..339284aa30 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -657,7 +657,7 @@ QCursor &QCursor::operator=(const QCursor &c) */ QCursor::operator QVariant() const { - return QVariant(QVariant::Cursor, this); + return QVariant(QMetaType::QCursor, this); } #ifndef QT_NO_DEBUG_STREAM diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 4ed9d032f6..596b7e44fd 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -178,25 +178,25 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) { switch (t) { - case QVariant::ByteArray: - if (d->type == QVariant::Color) { + case QMetaType::QByteArray: + if (d->type == QMetaType::QColor) { const QColor *c = v_cast(d); *static_cast(result) = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb).toLatin1(); return true; } break; - case QVariant::String: { + case QMetaType::QString: { QString *str = static_cast(result); switch (d->type) { #ifndef QT_NO_SHORTCUT - case QVariant::KeySequence: + case QMetaType::QKeySequence: *str = (*v_cast(d)).toString(QKeySequence::NativeText); return true; #endif - case QVariant::Font: + case QMetaType::QFont: *str = v_cast(d)->toString(); return true; - case QVariant::Color: { + case QMetaType::QColor: { const QColor *c = v_cast(d); *str = c->name(c->alpha() != 255 ? QColor::HexArgb : QColor::HexRgb); return true; @@ -206,85 +206,85 @@ static bool convert(const QVariant::Private *d, int t, } break; } - case QVariant::Pixmap: - if (d->type == QVariant::Image) { + case QMetaType::QPixmap: + if (d->type == QMetaType::QImage) { *static_cast(result) = QPixmap::fromImage(*v_cast(d)); return true; - } else if (d->type == QVariant::Bitmap) { + } else if (d->type == QMetaType::QBitmap) { *static_cast(result) = *v_cast(d); return true; - } else if (d->type == QVariant::Brush) { + } else if (d->type == QMetaType::QBrush) { if (v_cast(d)->style() == Qt::TexturePattern) { *static_cast(result) = v_cast(d)->texture(); return true; } } break; - case QVariant::Image: - if (d->type == QVariant::Pixmap) { + case QMetaType::QImage: + if (d->type == QMetaType::QPixmap) { *static_cast(result) = v_cast(d)->toImage(); return true; - } else if (d->type == QVariant::Bitmap) { + } else if (d->type == QMetaType::QBitmap) { *static_cast(result) = v_cast(d)->toImage(); return true; } break; - case QVariant::Bitmap: - if (d->type == QVariant::Pixmap) { + case QMetaType::QBitmap: + if (d->type == QMetaType::QPixmap) { *static_cast(result) = *v_cast(d); return true; - } else if (d->type == QVariant::Image) { + } else if (d->type == QMetaType::QImage) { *static_cast(result) = QBitmap::fromImage(*v_cast(d)); return true; } break; #ifndef QT_NO_SHORTCUT - case QVariant::Int: - if (d->type == QVariant::KeySequence) { + case QMetaType::Int: + if (d->type == QMetaType::QKeySequence) { const QKeySequence &seq = *v_cast(d); *static_cast(result) = seq.isEmpty() ? 0 : seq[0]; return true; } break; #endif - case QVariant::Font: - if (d->type == QVariant::String) { + case QMetaType::QFont: + if (d->type == QMetaType::QString) { QFont *f = static_cast(result); f->fromString(*v_cast(d)); return true; } break; - case QVariant::Color: - if (d->type == QVariant::String) { + case QMetaType::QColor: + if (d->type == QMetaType::QString) { static_cast(result)->setNamedColor(*v_cast(d)); return static_cast(result)->isValid(); - } else if (d->type == QVariant::ByteArray) { + } else if (d->type == QMetaType::QByteArray) { static_cast(result)->setNamedColor(QLatin1String(*v_cast(d))); return true; - } else if (d->type == QVariant::Brush) { + } else if (d->type == QMetaType::QBrush) { if (v_cast(d)->style() == Qt::SolidPattern) { *static_cast(result) = v_cast(d)->color(); return true; } } break; - case QVariant::Brush: - if (d->type == QVariant::Color) { + case QMetaType::QBrush: + if (d->type == QMetaType::QColor) { *static_cast(result) = QBrush(*v_cast(d)); return true; - } else if (d->type == QVariant::Pixmap) { + } else if (d->type == QMetaType::QPixmap) { *static_cast(result) = QBrush(*v_cast(d)); return true; } break; #ifndef QT_NO_SHORTCUT - case QVariant::KeySequence: { + case QMetaType::QKeySequence: { QKeySequence *seq = static_cast(result); switch (d->type) { - case QVariant::String: + case QMetaType::QString: *seq = QKeySequence(*v_cast(d)); return true; - case QVariant::Int: + case QMetaType::Int: *seq = QKeySequence(d->data.i); return true; default: @@ -294,7 +294,7 @@ static bool convert(const QVariant::Private *d, int t, } #endif #ifndef QT_NO_ICON - case QVariant::Icon: { + case QMetaType::QIcon: { if (ok) *ok = false; return false; diff --git a/src/gui/kernel/qinternalmimedata.cpp b/src/gui/kernel/qinternalmimedata.cpp index 8f4da1afb5..d5cdc743ee 100644 --- a/src/gui/kernel/qinternalmimedata.cpp +++ b/src/gui/kernel/qinternalmimedata.cpp @@ -112,22 +112,23 @@ QVariant QInternalMimeData::retrieveData(const QString &mimeType, QVariant::Type { QVariant data = retrieveData_sys(mimeType, type); if (mimeType == QLatin1String("application/x-qt-image")) { - if (data.isNull() || (data.type() == QVariant::ByteArray && data.toByteArray().isEmpty())) { + if (data.isNull() || (data.userType() == QMetaType::QByteArray && data.toByteArray().isEmpty())) { // try to find an image QStringList imageFormats = imageReadMimeFormats(); for (int i = 0; i < imageFormats.size(); ++i) { data = retrieveData_sys(imageFormats.at(i), type); - if (data.isNull() || (data.type() == QVariant::ByteArray && data.toByteArray().isEmpty())) + if (data.isNull() || (data.userType() == QMetaType::QByteArray && data.toByteArray().isEmpty())) continue; break; } } + int typeId = type; // we wanted some image type, but all we got was a byte array. Convert it to an image. - if (data.type() == QVariant::ByteArray - && (type == QVariant::Image || type == QVariant::Pixmap || type == QVariant::Bitmap)) + if (data.userType() == QMetaType::QByteArray + && (typeId == QMetaType::QImage || typeId == QMetaType::QPixmap || typeId == QMetaType::QBitmap)) data = QImage::fromData(data.toByteArray()); - } else if (mimeType == QLatin1String("application/x-color") && data.type() == QVariant::ByteArray) { + } else if (mimeType == QLatin1String("application/x-color") && data.userType() == QMetaType::QByteArray) { QColor c; QByteArray ba = data.toByteArray(); if (ba.size() == 8) { @@ -140,7 +141,7 @@ QVariant QInternalMimeData::retrieveData(const QString &mimeType, QVariant::Type } else { qWarning("Qt: Invalid color format"); } - } else if (data.type() != type && data.type() == QVariant::ByteArray) { + } else if (data.userType() != int(type) && data.userType() == QMetaType::QByteArray) { // try to use mime data's internal conversion stuf. QInternalMimeData *that = const_cast(this); that->setData(mimeType, data.toByteArray()); diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index e1244e1006..3a3dd42cae 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1404,7 +1404,7 @@ QKeySequence::SequenceMatch QKeySequence::matches(const QKeySequence &seq) const */ QKeySequence::operator QVariant() const { - return QVariant(QVariant::KeySequence, this); + return QVariant(QMetaType::QKeySequence, this); } /*! \fn QKeySequence::operator int () const diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index fc063bc72c..397c50f3dc 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -714,7 +714,7 @@ QPalette &QPalette::operator=(const QPalette &p) */ QPalette::operator QVariant() const { - return QVariant(QVariant::Palette, this); + return QVariant(QMetaType::QPalette, this); } /*! -- cgit v1.2.3 From 39396409656b12940ffe9b715f13e23ac4290eca Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 23 Jan 2020 15:48:15 +0100 Subject: Fix some qdoc-warnings src/corelib/tools/qmap.cpp:1199: (qdoc) warning: Can't link to 'QMultiMap::unite()' src/gui/kernel/qevent.cpp:949: (qdoc) warning: Unknown command '\see' src/gui/painting/qpaintengine_raster.cpp:344: (qdoc) warning: clang found diagnostics parsing \fn Type QRasterPaintEngine::type() const error: unknown type name 'Type' src/gui/doc/src/qtgui.qdoc:45: (qdoc) warning: Can't link to 'Build with CMake' examples/widgets/doc/src/gallery.qdoc:28: (qdoc) warning: Cannot find file 'widgets/gallery/gallery.pro' or 'widgets/gallery/gallery.pyproject' src/widgets/kernel/qwidget.cpp:5950: (qdoc) warning: Can't link to 'setFilePath' src/widgets/kernel/qshortcut.cpp:542: (qdoc) warning: No such parameter 'context' in QShortcut::QShortcut() Change-Id: I2395af854efebef719d4762da466f69f7c5aab9e Reviewed-by: Paul Wicking --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 3362294435..da77290c30 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -946,7 +946,7 @@ QWheelEvent::~QWheelEvent() \li or scrolling has ended and the distance did not change anymore (Qt::ScrollEnd). \endlist - \see pixelDelta() + \sa pixelDelta() */ /*! -- cgit v1.2.3 From f3d3c095a6bda505384ef56acab57b985d94fac5 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 6 Dec 2019 16:51:41 +0100 Subject: Register QColorSpace as a QtGui metatype Helps pass it through QVariant, and needed for QML support. Change-Id: Id161ff9b8f81ad55a7ee7a7c4c614bdf74bca4a1 Reviewed-by: Andy Nichols --- src/gui/kernel/qguivariant.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 596b7e44fd..215b2b1d74 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -41,6 +41,7 @@ #include "qbitmap.h" #include "qbrush.h" #include "qcolor.h" +#include "qcolorspace.h" #include "qcursor.h" #include "qfont.h" #include "qimage.h" -- cgit v1.2.3 From e79a6253813cd67954e371805da547c48ea32d3d Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sat, 14 Sep 2019 18:47:13 +0800 Subject: QCursor: Allow bitmap() and mask() to return by-value The previous versions of these functions that returned by-pointer are held over from Qt 1 times. They are inconsistent with the rest of the Qt API. [ChangeLog][QtGui][QCursor] QCursor::bitmap() and QCursor::mask() can now return by-value instead of by-pointer. Task-number: QTBUG-48701 Change-Id: I3ca4f0c28d5c831727a60309facfb49c74673bb7 Reviewed-by: Richard Moe Gustavsen --- src/gui/kernel/qcursor.cpp | 76 +++++++++++++++++++++++++++++++++++++++++++++- src/gui/kernel/qcursor.h | 15 +++++++-- 2 files changed, 88 insertions(+), 3 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 339284aa30..2018d28d92 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -325,7 +325,7 @@ QDataStream &operator<<(QDataStream &s, const QCursor &c) if (isPixmap) s << c.pixmap(); else - s << *c.bitmap() << *c.mask(); + s << c.bitmap(Qt::ReturnByValue) << c.mask(Qt::ReturnByValue); s << c.hotSpot(); } return s; @@ -565,7 +565,12 @@ void QCursor::setShape(Qt::CursorShape shape) } } +#if QT_DEPRECATED_SINCE(5, 15) /*! + \deprecated + + New code should use the other overload which returns QBitmap by-value. + Returns the cursor bitmap, or \nullptr if it is one of the standard cursors. */ @@ -577,6 +582,10 @@ const QBitmap *QCursor::bitmap() const } /*! + \deprecated + + New code should use the other overload which returns QBitmap by-value. + Returns the cursor bitmap mask, or \nullptr if it is one of the standard cursors. */ @@ -587,6 +596,71 @@ const QBitmap *QCursor::mask() const QCursorData::initialize(); return d->bmm; } +#endif // QT_DEPRECATED_SINCE(5, 15) + +/*! + \since 5.15 + + Returns the cursor bitmap, or a null bitmap if it is one of the + standard cursors. + + Previously, Qt provided a version of \c bitmap() which returned the bitmap + by-pointer. That version is now deprecated. To maintain compatibility + with old code, you can explicitly differentiate between the by-pointer + function and the by-value function: + + \code + const QBitmap *bmpPtr = cursor->bitmap(); + QBitmap bmpVal = cursor->bitmap(Qt::ReturnByValue); + \endcode + + If you disable the deprecated version, then you can omit \c Qt::ReturnByValue + as shown below: + + \code + QBitmap bmpVal = cursor->bitmap(); + \endcode +*/ +QBitmap QCursor::bitmap(Qt::ReturnByValue_t) const +{ + if (!QCursorData::initialized) + QCursorData::initialize(); + if (d->bm) + return *(d->bm); + return QBitmap(); +} + +/*! + \since 5.15 + + Returns the cursor bitmap mask, or a null bitmap if it is one of the + standard cursors. + + Previously, Qt provided a version of \c mask() which returned the bitmap + by-pointer. That version is now deprecated. To maintain compatibility + with old code, you can explicitly differentiate between the by-pointer + function and the by-value function: + + \code + const QBitmap *bmpPtr = cursor->mask(); + QBitmap bmpVal = cursor->mask(Qt::ReturnByValue); + \endcode + + If you disable the deprecated version, then you can omit \c Qt::ReturnByValue + as shown below: + + \code + QBitmap bmpVal = cursor->mask(); + \endcode +*/ +QBitmap QCursor::mask(Qt::ReturnByValue_t) const +{ + if (!QCursorData::initialized) + QCursorData::initialize(); + if (d->bmm) + return *(d->bmm); + return QBitmap(); +} /*! Returns the cursor pixmap. This is only valid if the cursor is a diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h index 7966e35840..7a11fe59ee 100644 --- a/src/gui/kernel/qcursor.h +++ b/src/gui/kernel/qcursor.h @@ -97,8 +97,19 @@ public: Qt::CursorShape shape() const; void setShape(Qt::CursorShape newShape); - const QBitmap *bitmap() const; - const QBitmap *mask() const; +#if QT_DEPRECATED_SINCE(5, 15) + QT_DEPRECATED_VERSION_X(5, 15, "Use the other overload which returns QBitmap by-value") + const QBitmap *bitmap() const; // ### Qt 7: Remove function + + QT_DEPRECATED_VERSION_X(5, 15, "Use the other overload which returns QBitmap by-value") + const QBitmap *mask() const; // ### Qt 7: Remove function + + QBitmap bitmap(Qt::ReturnByValue_t) const; + QBitmap mask(Qt::ReturnByValue_t) const; +#else + QBitmap bitmap(Qt::ReturnByValue_t = Qt::ReturnByValue) const; // ### Qt 7: Remove arg + QBitmap mask(Qt::ReturnByValue_t = Qt::ReturnByValue) const; // ### Qt 7: Remove arg +#endif // QT_DEPRECATED_SINCE(5, 15) QPixmap pixmap() const; QPoint hotSpot() const; -- cgit v1.2.3 From 12f085e538a1e3060fc5be3e21cefbb6d4c492b5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Oct 2019 16:01:47 +0200 Subject: Windows QPA: Add detection of dark mode Read the dark mode setting and make it accessible via native interface. Add a command line option to set the support level. Task-number: QTBUG-72028 Change-Id: I1e9fe296a6b1bda81512d003183038b866b67545 Reviewed-by: Oliver Wolff --- src/gui/kernel/qguiapplication.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 445ad6b835..1190bd1936 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -592,6 +592,21 @@ static QWindowGeometrySpecification windowGeometrySpecification = Q_WINDOW_GEOME \list \li \c {altgr}, detect the key \c {AltGr} found on some keyboards as Qt::GroupSwitchModifier (since Qt 5.12). + \li \c {darkmode=[1|2]} controls how Qt responds to the activation + of the \e{Dark Mode for applications} introduced in Windows 10 + 1903 (since Qt 5.15). + + A value of 1 causes Qt to switch the window borders to black + when \e{Dark Mode for applications} is activated and no High + Contrast Theme is in use. This is intended for applications + that implement their own theming. + + A value of 2 will in addition cause the Windows Vista style to + be deactivated and switch to the Windows style using a + simplified palette in dark mode. This is currently + experimental pending the introduction of new style that + properly adapts to dark mode. + \li \c {dialogs=[xp|none]}, \c xp uses XP-style native dialogs and \c none disables them. -- cgit v1.2.3 From ea4b837fa169c21afb79488b669d30bca2fcb94f Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 25 Jan 2020 20:15:19 +0100 Subject: Doc/QtGui: replace some 0 with \nullptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace some 'is 0' or 'are 0' where 0 referes to a nullptr with 'is \nullptr' and 'are \nullptr' Change-Id: Ic18d0c8bcf64159b4c8fae8c9499839954a98884 Reviewed-by: André Hartmann Reviewed-by: Sze Howe Koh --- src/gui/kernel/qevent.cpp | 2 +- src/gui/kernel/qopenglcontext.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index da77290c30..04970a942b 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3366,7 +3366,7 @@ QWhatsThisClickedEvent::~QWhatsThisClickedEvent() \a action is the action that is changed, added, or removed. If \a type is ActionAdded, the action is to be inserted before the - action \a before. If \a before is 0, the action is appended. + action \a before. If \a before is \nullptr, the action is appended. */ QActionEvent::QActionEvent(int type, QAction *action, QAction *before) : QEvent(static_cast(type)), act(action), bef(before) diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 124b39f2a9..ac5e279a79 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -941,7 +941,7 @@ GLuint QOpenGLContext::defaultFramebufferObject() const The latter may happen if the surface is not exposed, or the graphics hardware is not available due to e.g. the application being suspended. - If \a surface is 0 this is equivalent to calling doneCurrent(). + If \a surface is \nullptr this is equivalent to calling doneCurrent(). Avoid calling this function from a different thread than the one the QOpenGLContext instance lives in. If you wish to use QOpenGLContext from a -- cgit v1.2.3 From e44de91a2cab6e3c4632523e644fadaa93b89364 Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 26 Jan 2020 16:39:05 +0800 Subject: Doc: Clarify usage of Qt::ReturnByValue in QCursor Change-Id: I6ce2c658dc0e72beb9e7a2497c6dbdbc71d96bc5 Reviewed-by: Paul Wicking --- src/gui/kernel/qcursor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 2018d28d92..7f6fdafbd0 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -614,8 +614,8 @@ const QBitmap *QCursor::mask() const QBitmap bmpVal = cursor->bitmap(Qt::ReturnByValue); \endcode - If you disable the deprecated version, then you can omit \c Qt::ReturnByValue - as shown below: + If you disable the deprecated version using the QT_DISABLE_DEPRECATED_BEFORE + macro, then you can omit \c Qt::ReturnByValue as shown below: \code QBitmap bmpVal = cursor->bitmap(); @@ -646,8 +646,8 @@ QBitmap QCursor::bitmap(Qt::ReturnByValue_t) const QBitmap bmpVal = cursor->mask(Qt::ReturnByValue); \endcode - If you disable the deprecated version, then you can omit \c Qt::ReturnByValue - as shown below: + If you disable the deprecated version using the QT_DISABLE_DEPRECATED_BEFORE + macro, then you can omit \c Qt::ReturnByValue as shown below: \code QBitmap bmpVal = cursor->mask(); -- cgit v1.2.3 From 4bb897a3841f0f79150787e29fe122e1410bc119 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 10 Jan 2020 10:08:37 +0100 Subject: Deprecate all methods that use QMatrix Don't use QMatrix in implementation classes anymore. Task-number: QTBUG-46653 Fixes: QTBUG-81627 Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b Reviewed-by: Leena Miettinen Reviewed-by: Laszlo Agocs Reviewed-by: Lars Knoll --- src/gui/kernel/qguivariant.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 215b2b1d74..c9c45ba815 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -47,7 +47,6 @@ #include "qimage.h" #include "qkeysequence.h" #include "qtransform.h" -#include "qmatrix.h" #include "qpalette.h" #include "qpen.h" #include "qpixmap.h" -- cgit v1.2.3 From 1bd60749d140d14d152b59eccbda4790c517c54e Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 28 Jan 2020 12:34:18 +0100 Subject: QOpenGLContext: use extraFunctions instead of versioned functions Task-number: QTBUG-74409 Change-Id: I548cd4b683cbf67c9716d424b48fdc8b3f6a8c09 Reviewed-by: Laszlo Agocs --- src/gui/kernel/qopenglcontext.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index fbaff74561..6915433aed 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -372,20 +372,8 @@ int QOpenGLContextPrivate::maxTextureSize() GLint next = 64; funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - QOpenGLFunctions_1_0 *gl1funcs = nullptr; - QOpenGLFunctions_3_2_Core *gl3funcs = nullptr; - - if (q->format().profile() == QSurfaceFormat::CoreProfile) - gl3funcs = q->versionFunctions(); - else - gl1funcs = q->versionFunctions(); - - Q_ASSERT(gl1funcs || gl3funcs); - - if (gl1funcs) - gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size); - else - gl3funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size); + QOpenGLExtraFunctions *extraFuncs = q->extraFunctions(); + extraFuncs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &size); if (size == 0) { return max_texture_size; @@ -397,11 +385,7 @@ int QOpenGLContextPrivate::maxTextureSize() if (next > max_texture_size) break; funcs->glTexImage2D(proxy, 0, GL_RGBA, next, next, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - if (gl1funcs) - gl1funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next); - else - gl3funcs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next); - + extraFuncs->glGetTexLevelParameteriv(proxy, 0, GL_TEXTURE_WIDTH, &next); } while (next > size); max_texture_size = size; -- cgit v1.2.3