diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-10-04 14:38:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-10-04 14:38:28 +0200 |
commit | 0d2e5ae18f97339b9ef3a13c9c0130fbeb9bf886 (patch) | |
tree | fc1f1624c10f5d075bc01b38e5eca20081b7de67 | |
parent | 4b14bb8e24a928fa4218095d8d196a642e92e59e (diff) | |
parent | f5bc2b6e6e4985ee113c595abdd1a4bd8b3472fa (diff) |
Merge remote-tracking branch 'origin/wip/qt6' into dev
Change-Id: I284c4c3165807de5b6a4b314729f0534923f521d
-rw-r--r-- | .qmake.conf | 2 | ||||
-rw-r--r-- | src/imports/winextras/plugin.cpp | 4 | ||||
-rw-r--r-- | tests/manual/imageconversion/main.cpp | 14 |
3 files changed, 15 insertions, 5 deletions
diff --git a/.qmake.conf b/.qmake.conf index f0511dd..34387e8 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) DEFINES += QT_NO_FOREACH -MODULE_VERSION = 5.15.0 +MODULE_VERSION = 6.0.0 diff --git a/src/imports/winextras/plugin.cpp b/src/imports/winextras/plugin.cpp index 41b3fe8..eadf357 100644 --- a/src/imports/winextras/plugin.cpp +++ b/src/imports/winextras/plugin.cpp @@ -61,7 +61,9 @@ public: void registerTypes(const char *uri) Q_DECL_OVERRIDE { Q_ASSERT(uri == QLatin1String("QtWinExtras")); - qmlRegisterModule(uri, 1, QT_VERSION_MINOR); + // The minor version used to be the current Qt 5 minor. For compatibility it is the last + // Qt 5 release. + qmlRegisterModule(uri, 1, 15); qmlRegisterUncreatableType<QQuickWin>(uri, 1, 0, "QtWin", "Cannot create an instance of the QtWin namespace."); qmlRegisterType<QQuickDwmFeatures>(uri, 1, 0, "DwmFeatures"); qmlRegisterType<QQuickTaskbarButton>(uri, 1, 0, "TaskbarButton"); diff --git a/tests/manual/imageconversion/main.cpp b/tests/manual/imageconversion/main.cpp index def9cdb..f7f385c 100644 --- a/tests/manual/imageconversion/main.cpp +++ b/tests/manual/imageconversion/main.cpp @@ -91,7 +91,7 @@ static void formatImage(QDebug d, const QImage &image) d << image; if (const int colorTableSize = image.colorCount()) { QVector<QRgb> colorTable = image.colorTable(); - d << " Color table: " << colorTableSize << " (" << showbase << hex; // 256 by standard + d << " Color table: " << colorTableSize << " (" << Qt::showbase << Qt::hex; // 256 by standard int c = 0; for ( ; c < qMin(8, colorTableSize); ++c) { if (c) @@ -100,7 +100,7 @@ static void formatImage(QDebug d, const QImage &image) } if (c < colorTableSize) d << "..."; - d << ')' << noshowbase << dec; + d << ')' << Qt::noshowbase << Qt::dec; } formatData(d, image.constBits(), image.byteCount()); } @@ -175,7 +175,11 @@ class PaintWidget : public QWidget public: explicit PaintWidget(HBITMAP hBitmap, QWidget *p = nullptr) : QWidget(p), m_hBitmap(hBitmap) { } +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override; +#else bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; +#endif public slots: void saveBitmap(); @@ -188,7 +192,11 @@ private: const HBITMAP m_hBitmap; }; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool PaintWidget::nativeEvent(const QByteArray &eventType, void *messageIn, qintptr *result) +#else bool PaintWidget::nativeEvent(const QByteArray &eventType, void *messageIn, long *result) +#endif { MSG *message = reinterpret_cast<MSG *>(messageIn); if (message->message != WM_PAINT) @@ -347,7 +355,7 @@ int main(int argc, char *argv[]) if (image.isNull()) { qDebug() << "Default image color=" << defaultColor - << showbase << hex << defaultColor.rgba() << noshowbase << dec + << Qt::showbase << Qt::hex << defaultColor.rgba() << Qt::noshowbase << Qt::dec << ", format=" << drawFormat; image = QImage(width, height, drawFormat); image.fill(defaultColor); |