Add Qt6 support

qt6-qmake
Simon Stürz 2024-01-19 11:23:37 +01:00
parent 2adf638abf
commit 5bd0a413f1
4 changed files with 21 additions and 7 deletions

View File

@ -3,8 +3,20 @@ TEMPLATE = lib
QT += dbus network
QMAKE_CXXFLAGS *= -Werror -std=c++11 -g
QMAKE_LFLAGS *= -std=c++11
greaterThan(QT_MAJOR_VERSION, 5) {
message("Building using Qt6 support")
CONFIG *= c++17
QMAKE_LFLAGS *= -std=c++17
QMAKE_CXXFLAGS *= -std=c++17
} else {
message("Building using Qt5 support")
CONFIG *= c++11
QMAKE_LFLAGS *= -std=c++11
QMAKE_CXXFLAGS *= -std=c++11
DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x050F00
}
QMAKE_CXXFLAGS *= -Werror -g
DEFINES += VERSION_STRING=\\\"$${VERSION_STRING}\\\"

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2020, nymea GmbH
* Copyright 2013 - 2024, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@ -137,7 +137,7 @@ bool NetworkConnection::autoconnect() const
/*! Returns the timestamp of this \l{NetworkConnection} from the last connection. */
QDateTime NetworkConnection::timeStamp() const
{
return QDateTime::fromTime_t(m_connectionSettings.value("connection").value("timestamp").toUInt());
return QDateTime::fromSecsSinceEpoch(m_connectionSettings.value("connection").value("timestamp").toUInt());
}
QDebug operator<<(QDebug debug, NetworkConnection *networkConnection)

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2020, nymea GmbH
* Copyright 2013 - 2024, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@ -45,6 +45,7 @@
#include <QDebug>
#include <QTimer>
#include <QMetaEnum>
#include <QRegularExpression>
#include <arpa/inet.h>
@ -346,7 +347,7 @@ NetworkManager::NetworkManagerError NetworkManager::createWiredAutoConnection(co
QVariantMap connectionSettings {
{"id", "auto"},
{"autoconnect", true},
{"uuid", QUuid::createUuid().toString().remove(QRegExp("[{}]"))},
{"uuid", QUuid::createUuid().toString().remove(QRegularExpression("[{}]"))},
{"type", "802-3-ethernet"}
};
@ -411,7 +412,7 @@ NetworkManager::NetworkManagerError NetworkManager::createWiredManualConnection(
QVariantMap connectionSettings {
{"id", "manual"},
{"autoconnect", true},
{"uuid", QUuid::createUuid().toString().remove(QRegExp("[{}]"))},
{"uuid", QUuid::createUuid().toString().remove(QRegularExpression("[{}]"))},
{"type", "802-3-ethernet"}
};

View File

@ -69,6 +69,7 @@ public:
WirelessCapability5Ghz = 0x0400,
};
Q_ENUM(WirelessCapability)
Q_DECLARE_FLAGS(WirelessCapabilities, WirelessCapability)
Q_FLAG(WirelessCapabilities)