Home > Back-end >  Qt how to accept WM_USER 100 signal
Qt how to accept WM_USER 100 signal

Time:10-01

My Qt project load a DLL library, click on a button, the library sent wm_USER + 100 signal, I in my Qt project how to accept the signal? Winevent can only accept the system signal, can't accept the user-defined signal, I am using Qt4

CodePudding user response:

Premise is you of the library in send custom signal, send handle is qt form,
Then signal can be processed in inside qt:
 
Bool QWidgetB: : winEvent (MSG * message, long * result)
{
If (message - & gt; Message==(WM_USER + 100))
{
QString * text=(QString *) message - & gt; WParam.
QString STR=* text;
UI. TextEdit - & gt; Append (STR);
}
Return QWidget: : winEvent (message, result);


Specific can refer to: https://blog.csdn.net/qiangzi4646/article/details/75095894
  • Related