I'm trying to show some connected/disconnected messages on the status bar in my application. It is a console application written in c++, with a Qt GUI. When something changes in the connections status, the connection handler calls a callback (in some gui related object), which updates the GUI. I can draw on my QGraphicsScene, but when i try to use showMessage method of QStatusBar, sometimes it crash immediately, sometimes it works until a few calls (but the message isn't disappear after the timeout elapsed). I get this error message:
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QStatusBar(0xae55feb0), parent's thread is QThread(0xb3e006f0), current thread is QThread(0xb0c00478)
QObject::startTimer: QTimer can only be used with threads started with QThread
QPixmap: It is not safe to use pixmaps outside the GUI thread
I think that means the showMessage is not called from the GUI thread. Then how could i display connection status changes on the status bar?