Qt-interest Archive, May 2008
Mapping user-defined message to a handler functions
Message 1 in thread
Dear
I have some question about mapping user-defined message to a handler
functions and how to retrieve the messages and information?
1)
Is there a macro or function or ... on QT which allowed me to map
user-defined message to a handler functions?
(The Microsoft Foundation Class Library provides ON_MESSAGE macro to map
user-defined message to a handler functions)
2)
Is there a function on Qt which allowed me to get the message being
processed ?
MFC provides a function called GetCurrentMessage that returns a pointer
to a MSG structure encapsulating the current message being processed
typedef struct tagMSG {
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
DWORD time;
POINT pt;
} MSG;
hwnd ==> Identifies the window whose window procedure receives the message.
message ==> Specifies the message number.
wParam ==> Specifies additional information about the message. The exact
meaning depends on the value of the message member.
lParam ==> Specifies additional information about the message. The exact
meaning depends on the value of the message member.
time ==> Specifies the time at which the message was posted.
pt ==> Specifies the cursor position, in screen coordinates, when the
message was posted.
How to do this with Qt?
I am blocked then please do not delay in answering me and give me the
way forward to resolve all this.
Thanks in advance
Best reagrds
--
[ signature omitted ]
Message 2 in thread
Wassim BELHADJ wrote:
> Dear
>
> I have some question about mapping user-defined message to a handler
> functions and how to retrieve the messages and information?
>
>
> 1)
>
> Is there a macro or function or ... on QT which allowed me to map
> user-defined message to a handler functions?
>
> (The Microsoft Foundation Class Library provides ON_MESSAGE macro to map
> user-defined message to a handler functions)
>
> 2)
>
> Is there a function on Qt which allowed me to get the message being
> processed ?
>
> MFC provides a function called GetCurrentMessage that returns a pointer
> to a MSG structure encapsulating the current message being processed
>
> typedef struct tagMSG { HWND hwnd;
> UINT message;
> WPARAM wParam;
> LPARAM lParam;
> DWORD time;
> POINT pt;
> } MSG;
>
> hwnd ==> Identifies the window whose window procedure receives the message.
>
> message ==> Specifies the message number.
>
> wParam ==> Specifies additional information about the message. The exact
> meaning depends on the value of the message member.
>
> lParam ==> Specifies additional information about the message. The exact
> meaning depends on the value of the message member.
>
> time ==> Specifies the time at which the message was posted.
>
> pt ==> Specifies the cursor position, in screen coordinates, when the
> message was posted.
>
>
> How to do this with Qt?
>
> I am blocked then please do not delay in answering me and give me the
> way forward to resolve all this.
You could take a look at either the QCoreApplication::setEventFilter() or
QCoreApplication::winEventFilter() functions, they might help you.
http://doc.trolltech.com/4.4/qcoreapplication.html#setEventFilter
http://doc.trolltech.com/4.4/qcoreapplication.html#winEventFilter
--
[ signature omitted ]
Message 3 in thread
Wassim BELHADJ wrote:
> En fait je suis novice avec Qt est ce que vous pouvez m'aider s'il vous
> plait... Comment on fait avec QCoreApplication::setEventFilter() j'ai lui la
> doc mais j'ai rien compris
> Merci d'avance
I'm sorry, I don't speak French, could you resend it in English?
(PS: it's best to send replies to the newsgroup so that the whole
conversation appears in the archives.)
--
[ signature omitted ]
Message 4 in thread
On Thursday 22 May 2008 15:52:14 Bradley T. Hughes wrote:
> Wassim BELHADJ wrote:
> > En fait je suis novice avec Qt est ce que vous pouvez m'aider s'il vous
> > plait... Comment on fait avec QCoreApplication::setEventFilter() j'ai lui
> > la doc mais j'ai rien compris
> > Merci d'avance
>
> I'm sorry, I don't speak French, could you resend it in English?
>
> (PS: it's best to send replies to the newsgroup so that the whole
> conversation appears in the archives.)
Translation:
"In fact I'm a newbie in Qt programming. Can you help me please? How do you
use QCoreApplication::setEventFilter()? I read the documentation but I didn't
understand it.
Thanks in advance"
--
[ signature omitted ]