::PostMessage in Qt !
-
Hello,
I have to convert C++ win32 API to , Qt DLL.
In doing this, i struked in using **::PostMessage ** funictionality in Qt.
::PostMessage(m_hwndDest,m_nQuaternionMsg,MAKEWPARAM(marg,eErrors),LPARAM(m_lParam));Could anyone please let me know,
How can i use, ::PostMessage funtionality in Qt ? -
@Velab You have a few options here, the first one is using QCoreApplication::postEvent, it will simulate the
PostMessage
.The other solution is to use QTimer::singleShot, you can use with the
msec
as0
, which you would have the same functionality.And one similar to
QTimer
but passing arguments, you could use QMetaObject::invokeMethod withQt::QueuedConnection
astype
parameter.Qt::DirectConnection
would execute the method immediately, whilstQt::QueuedConnection
would queue in the event loop. -
@Minupi
Thank you for the reply, I will try as you mentioned above.
and back to you.