Error because of thread ..



  • I am using the QLineedit in my application (lineedit->setEnabled(false)).. but when in my application that QLineedit is accessed , it shows its being used by some other thread , where as the current thread is something different ..

    The error displays in a dialog box having 3 button (abort, retry, ignore )when i am debugging with the following text .

    **ASSERT failure in QCoreApplication::sendevent:"cannot send events to objects owned by a different thread . Current thread 1c24db20 .Receiver 'Lineedit'(oftype 'QLineedit') was created in thread 90c2a18",file kernel\qcoreapplication.cpp,line330 **

    can anyone help for resolving this issue ??

    Thankx in adv .



  • This can't be solved by this little information.
    Typically this happens when you have multiple threads in the game.



  • so what information you need ?



  • Make sure you don't access any GUI elements from any other thread than the GUI thread (main thread); you are not allowed to do that. If you need to manipulate GUI elements from secondary threads you will have to use (asynchronous) signals and slots (as well for QLineEdit::setEnabled()).



  • Are you using threads in your app?



  • "you will have to use (asynchronous) signals and slots"

    --> Use Qt::QueuedConnection as the Qt::ConnectionType parameter of QObject::connect(...) parameter, to detach the threads.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.