Witam.
Mam pewien problem, z wystartowaniem wątku w slocie od przerwania po timeout() od QTimer. Co zabawne kod na linuxie działa, a windows się wypiął na mnie. Pozwolę sobie na skróty kodu, ale mam nadzieje, że wszystko będzie zrozumiałe.
Kod z linuxa jest identyczny, jeśli chodzi o sam mechanizm slotów i sygnałów.
W konstruktorze indywidualnej klasy
thread = new QThread(this);
timer = new QTimer();
timer->moveToThread(thread);
QObject::connect(timer , SIGNAL(timeout()) ,this , SLOT(SLOT_to()) , Qt::DirectConnection);
QObject::connect(thread , SIGNAL(started()) , timer , SLOT(start()));
QObject::connect(thread, SIGNAL(finished()) , timer, SLOT(stop()));
wątek się uruchamia (sprawdzilem adresy przy pomocy QThread::currentthread();), ale sypie bugami
QObject::connect: Cannot queue arguments of type 'QTextBlock'
(Make sure 'QTextBlock' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QTextCursor'
(Make sure 'QTextCursor' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QVector<int>'
(Make sure 'QVector<int>' is registered using qRegisterMetaType().)
Dodam, że bez użycia Qt::DirectConnection, wątek się nie uruchamia, z użyciem QueuedConnection również echo. Jakieś sugestie ?