Skip to content

Commit d55163b

Browse files
committed
Fixing Qt6 build
1 parent 777e95b commit d55163b

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

qtservice/src/qtservice.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ QtServiceBase::QtServiceBase(int argc, char **argv, const QString &name)
626626
d_ptr = new QtServiceBasePrivate(nm);
627627
d_ptr->q_ptr = this;
628628

629-
d_ptr->serviceFlags = 0;
629+
d_ptr->serviceFlags = {};
630630
d_ptr->sysd = 0;
631631
for (int i = 0; i < argc; ++i)
632632
d_ptr->args.append(QString::fromLocal8Bit(argv[i]));

qtservice/src/qtservice.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
# define QT_QTSERVICE_EXPORT
2323
#endif
2424

25+
#if QT_VERSION >= 0x060000
26+
#include <QtCore/qcontainerfwd.h>
27+
#else
2528
class QStringList;
29+
#endif
2630
class QtServiceControllerPrivate;
2731

2832
class QT_QTSERVICE_EXPORT QtServiceController

qtservice/src/qtservice_win.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,18 @@ class QtServiceAppEventFilter : public QAbstractNativeEventFilter
700700
{
701701
public:
702702
QtServiceAppEventFilter() {}
703+
#if QT_VERSION >= 0x060000
704+
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
705+
#else
703706
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
707+
#endif
704708
};
705709

710+
#if QT_VERSION >= 0x060000
711+
bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &, void *message, qintptr *result)
712+
#else
706713
bool QtServiceAppEventFilter::nativeEventFilter(const QByteArray &, void *message, long *result)
714+
#endif
707715
{
708716
MSG *winMessage = (MSG*)message;
709717
if (winMessage->message == WM_ENDSESSION && (winMessage->lParam & ENDSESSION_LOGOFF)) {

0 commit comments

Comments
 (0)