Use qintptr in QWidget::nativeEvent on Qt 6 (#4376)
This commit is contained in:
@@ -52,6 +52,7 @@
|
|||||||
- Dev: Disabled ImageExpirationPool in tests. (#4363)
|
- Dev: Disabled ImageExpirationPool in tests. (#4363)
|
||||||
- Dev: Don't rely on undocumented registry keys to find the default browser on Windows. (#4362)
|
- Dev: Don't rely on undocumented registry keys to find the default browser on Windows. (#4362)
|
||||||
- Dev: Use `QEnterEvent` for `QWidget::enterEvent` on Qt 6. (#4365)
|
- Dev: Use `QEnterEvent` for `QWidget::enterEvent` on Qt 6. (#4365)
|
||||||
|
- Dev: Use `qintptr` in `QWidget::nativeEvent` on Qt 6. (#4376)
|
||||||
|
|
||||||
## 2.4.0
|
## 2.4.0
|
||||||
|
|
||||||
|
|||||||
@@ -631,8 +631,13 @@ void BaseWindow::moveIntoDesktopRect(QPoint point)
|
|||||||
this->move(point);
|
this->move(point);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message,
|
||||||
|
qintptr *result)
|
||||||
|
#else
|
||||||
bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message,
|
bool BaseWindow::nativeEvent(const QByteArray &eventType, void *message,
|
||||||
long *result)
|
long *result)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef USEWINSDK
|
#ifdef USEWINSDK
|
||||||
MSG *msg = reinterpret_cast<MSG *>(message);
|
MSG *msg = reinterpret_cast<MSG *>(message);
|
||||||
@@ -830,7 +835,11 @@ bool BaseWindow::handleSHOWWINDOW(MSG *msg)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
bool BaseWindow::handleNCCALCSIZE(MSG *msg, qintptr *result)
|
||||||
|
#else
|
||||||
bool BaseWindow::handleNCCALCSIZE(MSG *msg, long *result)
|
bool BaseWindow::handleNCCALCSIZE(MSG *msg, long *result)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef USEWINSDK
|
#ifdef USEWINSDK
|
||||||
if (this->hasCustomWindowFrame())
|
if (this->hasCustomWindowFrame())
|
||||||
@@ -914,7 +923,11 @@ bool BaseWindow::handleMOVE(MSG *msg)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
bool BaseWindow::handleNCHITTEST(MSG *msg, qintptr *result)
|
||||||
|
#else
|
||||||
bool BaseWindow::handleNCHITTEST(MSG *msg, long *result)
|
bool BaseWindow::handleNCHITTEST(MSG *msg, long *result)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef USEWINSDK
|
#ifdef USEWINSDK
|
||||||
const LONG border_width = 8; // in pixels
|
const LONG border_width = 8; // in pixels
|
||||||
|
|||||||
@@ -67,8 +67,13 @@ public:
|
|||||||
static bool supportsCustomWindowFrame();
|
static bool supportsCustomWindowFrame();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool nativeEvent(const QByteArray &eventType, void *message,
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
long *result) override;
|
bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
|
qintptr *result) override;
|
||||||
|
#else
|
||||||
|
bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
|
long *result) override;
|
||||||
|
#endif
|
||||||
virtual void scaleChangedEvent(float) override;
|
virtual void scaleChangedEvent(float) override;
|
||||||
|
|
||||||
virtual void paintEvent(QPaintEvent *) override;
|
virtual void paintEvent(QPaintEvent *) override;
|
||||||
@@ -103,10 +108,15 @@ private:
|
|||||||
|
|
||||||
bool handleDPICHANGED(MSG *msg);
|
bool handleDPICHANGED(MSG *msg);
|
||||||
bool handleSHOWWINDOW(MSG *msg);
|
bool handleSHOWWINDOW(MSG *msg);
|
||||||
bool handleNCCALCSIZE(MSG *msg, long *result);
|
|
||||||
bool handleSIZE(MSG *msg);
|
bool handleSIZE(MSG *msg);
|
||||||
bool handleMOVE(MSG *msg);
|
bool handleMOVE(MSG *msg);
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
bool handleNCCALCSIZE(MSG *msg, qintptr *result);
|
||||||
|
bool handleNCHITTEST(MSG *msg, qintptr *result);
|
||||||
|
#else
|
||||||
|
bool handleNCCALCSIZE(MSG *msg, long *result);
|
||||||
bool handleNCHITTEST(MSG *msg, long *result);
|
bool handleNCHITTEST(MSG *msg, long *result);
|
||||||
|
#endif
|
||||||
|
|
||||||
bool enableCustomFrame_;
|
bool enableCustomFrame_;
|
||||||
ActionOnFocusLoss actionOnFocusLoss_ = Nothing;
|
ActionOnFocusLoss actionOnFocusLoss_ = Nothing;
|
||||||
|
|||||||
@@ -27,8 +27,13 @@ FramelessEmbedWindow::FramelessEmbedWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USEWINSDK
|
#ifdef USEWINSDK
|
||||||
|
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType,
|
||||||
|
void *message, qintptr *result)
|
||||||
|
# else
|
||||||
bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType,
|
bool FramelessEmbedWindow::nativeEvent(const QByteArray &eventType,
|
||||||
void *message, long *result)
|
void *message, long *result)
|
||||||
|
# endif
|
||||||
{
|
{
|
||||||
MSG *msg = reinterpret_cast<MSG *>(message);
|
MSG *msg = reinterpret_cast<MSG *>(message);
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,15 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef USEWINSDK
|
#ifdef USEWINSDK
|
||||||
|
|
||||||
|
# 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,
|
bool nativeEvent(const QByteArray &eventType, void *message,
|
||||||
long *result) override;
|
long *result) override;
|
||||||
|
# endif
|
||||||
|
|
||||||
void showEvent(QShowEvent *event) override;
|
void showEvent(QShowEvent *event) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user