diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-05 16:40:44 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-08-06 09:43:39 +0200 |
commit | f02f5165fe637de349d9a2240c1fb4d8ec253470 (patch) | |
tree | 1c6ef55f7365c8f4b70d3b682af2164120e604db | |
parent | 4f6c8fd119a93a4c1627cdba606daa5dad348e39 (diff) |
Fix Qt6 build
Fixes a source incompatibility due to the changed signature of
QWidget::nativeEvent in 6.0,
where the compiler can't convert
from long int* to qintptr* (aka long long int*).
The change was introduced in qtbase in
3b38c73c7ffa71c00c172cf0e05742835a304300 .
Change-Id: I7ff68616de7af8ce6ee0f885b0ed18ca172434b5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | tests/manual/imageconversion/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/manual/imageconversion/main.cpp b/tests/manual/imageconversion/main.cpp index 7e61a7d..f7f385c 100644 --- a/tests/manual/imageconversion/main.cpp +++ b/tests/manual/imageconversion/main.cpp @@ -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) |