I have two thread, A use PostMessage() sending one message to B.
But B can not receive user-defined event. Here I use Widget::event(),
How can I get this user-defined message?
I have two thread, A use PostMessage() sending one message to B.
But B can not receive user-defined event. Here I use Widget::event(),
How can I get this user-defined message?
I don't think you can use Widgets Class in a thread, read QThread Documentation
... "Note, however, that it is not possible to use any widget classes in the thread"...
You can use plain signal-slot to communicate, lets say an object in thread A sends a signal to a slot of an object in thread B, (provided they are connected). This is possible. May be then you can pass the complete user-defined message in the signal to the slot.
If you use WinAPI for sending, you need to use WinAPI for receiving as well.
Native Windows events ? Or can try QWidget::winEvent ( MSG * message, long * result )
Bookmarks