From 2bda41ecad0a5ef8a5e6f798c8f855b03ba2b7ae Mon Sep 17 00:00:00 2001 From: Carlo Baratto Date: Tue, 17 Nov 2026 12:14:42 +0100 Subject: [PATCH] Push: QThread::create non esiste in Qt 5.6, sottoclasse con run() --- src/pushservice.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pushservice.cpp b/src/pushservice.cpp index f1abeba..b9af52a 100644 --- a/src/pushservice.cpp +++ b/src/pushservice.cpp @@ -172,6 +172,16 @@ void preparaPercorsiMotore() } } +namespace { +// QThread::create() arriva in Qt 5.10; qui il target รจ Qt 5.6: il ciclo del +// motore va in una sottoclasse con run(). +class ThreadMotore : public QThread +{ +public: + void run() override { gd_engine_run(); } +}; +} + int risveglioPush(int argc, char *argv[]) { static int uno = 1; @@ -187,8 +197,8 @@ int risveglioPush(int argc, char *argv[]) EngineBridge bridge; EngineBridge::setInstance(&bridge); - QThread *motore = QThread::create([] { gd_engine_run(); }); - motore->start(); + ThreadMotore motore; + motore.start(); // Tetto di sicurezza: un risveglio non deve restare appeso. QTimer::singleShot(60000, &app, [&app]() {