0

I am trying to show message box in pyside python in function called from thread but I got error " Fatal IO error: client killed" and form closes while it shows correctly if I called function normally without thread

code for button click when defining the thread

mythread = Thread(target=self.main_campaign)
mythread.start()

the function as below

def main_campaign(self):
    QMessageBox.question(self, 'title', 'text', QMessageBox.Yes | QMessageBox.No)
Mohamed Yousof
  • 725
  • 1
  • 9
  • 38
  • can you add the whole error stack trace? – Elisha Sep 09 '14 at 11:16
  • are you using a Python thread object or a QThread? Using a QThread can solve your problem. – mguijarr Sep 09 '14 at 11:19
  • from threading import Thread – Mohamed Yousof Sep 09 '14 at 11:29
  • QObject::installEventFilter(): Cannot filter events for objects in a different thread. [xcb] Unknown request in queue while dequeuing [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. python2.7: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed. – Mohamed Yousof Sep 09 '14 at 11:30

0 Answers0