You are not starting the new thread, you are executing its run() method in the main thread.
Cheers,
_
You are not starting the new thread, you are executing its run() method in the main thread.
Cheers,
_
Hi again anda_skoa,
You are right. It has been a mistake from me. I modified that piece of code for count the time in do all the operations in one thread and I forgot it .
But the code referred to the main question is :
@
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
//do the operations in a different thread
//MyQThread inherits of QThread
MyQThread *hilo = new MyQThread ();
hilo->start();
Receiver receiver;
QQmlContext* ctx = engine.rootContext();
//Introduce receiver as object
ctx->setContextProperty("receiver", &receiver);
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
return app.exec();
}
@
Sorry for the inconveniences and thanks for the reply.
I think that almost nobody develops Android apps with Qt because there is no info enough in QT's web or in forums. I wish this changes because QtQuick is a good tool to do it.
I am going to try to do it with C++ threads and I will post the result.
Regards,
A.
So which of the two threads is not running?
The one used by MyQThread's instance?
Does it emit the started() signal?
I am pretty sure that Qt's thread will work, otherwise plenty of Qt internal code would stop working and aside from Qt's automated tests at least some of the application developers would have noticed.
Cheers,
_
Yes , I am talking about MyThread's instance. The signal is emitted.
About the Qt's threads in Android,
I supposed it too. But I am not able to do it works in Android.
I have tried to find some info on the Internet about that topic but I don't have found nothing.
I keep trying new forms to do it.
Cheers,
So the thread emits started() but you don't get any output that you put into run()?
Cheers,
_
Bookmarks