From 2bc825bf54f40dc3349ed5b6c10ffb0cc58997dd Mon Sep 17 00:00:00 2001 From: markuspg Date: Tue, 15 Sep 2020 13:10:44 +0200 Subject: [PATCH] Register state_t enumeration only once --- src/Lib/client.cpp | 2 -- src/main.cpp | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Lib/client.cpp b/src/Lib/client.cpp index c068abf..119912e 100644 --- a/src/Lib/client.cpp +++ b/src/Lib/client.cpp @@ -36,8 +36,6 @@ lc::Client::Client(const QString &argIP, const QString &argMAC, unsigned short int argYPosition, const QString &argPingCmd) : ip{argIP}, mac{argMAC}, name{argName}, xPosition{argXPosition}, yPosition{argYPosition}, protectedCycles{0} { - qRegisterMetaType("STATE"); - if (!argPingCmd.isEmpty()) { pinger = new ClientPinger{ip, argPingCmd}; pinger->moveToThread(&pingerThread); diff --git a/src/main.cpp b/src/main.cpp index d2224bd..c62db4f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,6 +28,9 @@ std::unique_ptr settings; int main(int argc, char *argv[]) { QApplication a{argc, argv}; + + qRegisterMetaType(); + settings.reset(new lc::Settings{QSettings{"Labcontrol", "Labcontrol"}}); lc::MainWindow w; w.show();