Пример #1
0
int main(int argc, char *argv[]){
	QCoreApplication app(argc, argv);
	HelloThread thread;
	thread.start();
	qDebug() << "hello from GUI thread " << app.thread()->currentThreadId();
	thread.wait();  // do not exit before the thread is completed!
	return 0;
}
Пример #2
0
int main(int argc, char *argv[])
{
    _argc = &argc;
    _argv = argv;

    thread.start();
    thread.wait();
    return 0;
}
Пример #3
0
int main(int argc, char *argv[])
{
	QCoreApplication app(argc, argv);

	HelloThread helloThread;
	helloThread.start();
	qDebug() << "Main thread ID is: " << (int)QThread::currentThreadId();
	helloThread.wait();

	return 0;
}