Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Qt6 build #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qtservice/src/qtservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ QtServiceBase::QtServiceBase(int argc, char **argv, const QString &name)
d_ptr = new QtServiceBasePrivate(nm);
d_ptr->q_ptr = this;

d_ptr->serviceFlags = 0;
d_ptr->serviceFlags = {};
d_ptr->sysd = 0;
for (int i = 0; i < argc; ++i)
d_ptr->args.append(QString::fromLocal8Bit(argv[i]));
Expand Down
4 changes: 4 additions & 0 deletions qtservice/src/qtservice.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
# define QT_QTSERVICE_EXPORT
#endif

#if QT_VERSION >= 0x060000
#include <QtCore/qcontainerfwd.h>
#else
class QStringList;
#endif
class QtServiceControllerPrivate;

class QT_QTSERVICE_EXPORT QtServiceController
Expand Down
8 changes: 8 additions & 0 deletions qtservice/src/qtservice_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,18 @@ class QtServiceAppEventFilter : public QAbstractNativeEventFilter
{
public:
QtServiceAppEventFilter() {}
#if QT_VERSION >= 0x060000
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result);
#else
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result);
#endif
};

#if QT_VERSION >= 0x060000
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