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

Fix build with Qt 6 #61

Open
wants to merge 2 commits 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: 2 additions & 0 deletions include/nzmqt/impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ NZMQT_INLINE PollingZMQSocket::PollingZMQSocket(PollingZMQContext* context_, Typ

NZMQT_INLINE PollingZMQContext::PollingZMQContext(QObject* parent_, int io_threads_)
: super(parent_, io_threads_)
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
, m_pollItemsMutex(QMutex::Recursive)
#endif
, m_interval(NZMQT_POLLINGZMQCONTEXT_DEFAULT_POLLINTERVAL)
, m_stopped(false)
{
Expand Down
8 changes: 6 additions & 2 deletions include/nzmqt/nzmqt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ namespace nzmqt
// If the polling process is not stopped (by a previous call to the 'stop()' method) this
// method will call the 'poll()' method once and re-schedule a subsequent call to this method
// using the current polling interval.
void run();
void run() override;

// This method will poll on all currently available poll-items (known ZMQ sockets)
// using the given timeout to wait for incoming messages. Note that this timeout has
Expand All @@ -474,7 +474,11 @@ namespace nzmqt
typedef QVector<pollitem_t> PollItems;

PollItems m_pollItems;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QRecursiveMutex m_pollItemsMutex;
#else
QMutex m_pollItemsMutex;
#endif
int m_interval;
volatile bool m_stopped;
};
Expand Down Expand Up @@ -534,7 +538,7 @@ namespace nzmqt
void notifierError(int errorNum, const QString& errorMsg);

protected:
SocketNotifierZMQSocket* createSocketInternal(ZMQSocket::Type type_);
SocketNotifierZMQSocket* createSocketInternal(ZMQSocket::Type type_) override;
};

NZMQT_API inline ZMQContext* createDefaultContext(QObject* parent_ = nullptr, int io_threads_ = NZMQT_DEFAULT_IOTHREADS)
Expand Down