Skip to content

Commit

Permalink
Qt6: Fix windows complie error
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Jan 12, 2022
1 parent 8153ef3 commit fb57149
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions qtservice/src/qtservice_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,10 +737,17 @@ class QtServiceAppEventFilter : public QAbstractNativeEventFilter
{
public:
QtServiceAppEventFilter() {}
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
virtual bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
#else
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
#endif
};

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &, void *message, qintptr *result)
#else
bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result)
#endif
{
MSG *winMessage = (MSG*)message;
if (winMessage->message == WM_ENDSESSION && (winMessage->lParam & ENDSESSION_LOGOFF)) {
Expand Down

0 comments on commit fb57149

Please sign in to comment.