Push: QThread::create non esiste in Qt 5.6, sottoclasse con run()

This commit is contained in:
Carlo Baratto committed 2026-11-17 12:14:42 +01:00
1 parent d9aa530ffd
commit 2bda41ecad
1 file changed
+12 -2
+12 -2
View File
@@ -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]() {