I have this global variable. void * userInterface; and this line in main.cpp _beginthread( ReceiveThread, 0, NULL); and


void ReceiveThread( void* Param )
	QString str;
	rovkonInterface *w=((rovkonInterface *)userInterface);

and I get runtime error:
ASSERT:"qApp && qApp->thread()==currentQThread" in file ....

and I tested same code snippet in normal functions and it worked properly. Also I used other global variable also without a problem, but when insert the line: w->ui.systemStatusText->insertPlainText("abc"); I am getting runtime error.

What can be the problem?

Is the global variable shared between threads?

The assert seems to be checking that some property is equal to the current thread.
The assert is triggered when this is NO LONGER TRUE

My deduction is that you have several threads munging the same data, and sooner or later, boom.