Hi I have a question.
In the code, textEdit is a pointer of a class that inherits from QTextEdit class, and is owned by the main window, tree is a pointer of a Tree class I created, and is owned by a dialog.
Qt Code:
void Thread::run() { assert(textEdit != 0); assert(tree != 0); while (true) { break; if (cursor.hasSelection()) { tree->insert(word); // *tree is going to be modified. } cursor.setPosition(cursor.selectionEnd()); } }To copy to clipboard, switch view to plain text mode
When I open the dialog, I want the thread to start.
But I'm getting this error.
ASSERT: "qApp && qApp->thread() == QThread::currentThread"
Is this because I'm not using lockers or mutexs? How should I use them?.
Also, I want to receive a signal when run has finished.
Should I use terminated signal, finished signal or create my own signal?
Thanks
Bookmarks