Re: Get mouse events in MAC
Code:
bool RightSideBar::winEvent(MSG *msg, long *result)
{
bool retval = true;
switch (msg->message)
{
case WM_NCLBUTTONDOWN:
qDebug()<<"Using Windows API Button Down";
break;
case WM_NCLBUTTONUP:
qDebug()<<"Using Windows API Button UP";
break;
default:
retval = false;
}
return retval;
}
But here resize and widget move options are not working in our application.We also need the same event(winEvent) in MAC OS .Can anyone help us in this?
Re: Get mouse events in MAC
QWidget::macEvent() seems fairly obvious (or QApplication::macEventFilter() for earlier Qt versions). Once you abandon the platform independence of Qt you are much less likely to get responses in here.
Your winEvent code returns true for these two events which will stop any further processing by Qt. Perhaps that is what is breaking the "resize and widget move options" you complain about.
Re: Get mouse events in MAC
we need to get the mouse up event on Application's Title bar in Windows and MAC OS.In window we got the solution,but in MAC we don't know how to get mouse up event on Title bar.
Code:
//Function for getting Mouse Event on TitleBar in Windows.
#ifdef Q_OS_WIN
bool RightSideBar::winEvent(MSG *msg, long *result)//This function working fine in our application
{
switch (msg->message)
{
case 562:
{
qDebug()<<"Using Windows API Mouse Button UP"<<msg->message;
return false;
break;
}
}
return false;
}
#endif
//End Function for getting Mouse Event on TitleBar in Windows.
//Function for getting Mouse Event on TitleBar in MAC.
#ifdef Q_OS_MAC
bool RightSideBar::macEvent(EventHandlerCallRef caller, EventRef event)
{
qDebug()<<"Inside MAC event.....";//we dont know how to get mouse event here
return false;
}
#endif
please help us..
Re: Get mouse events in MAC
I Googled the docs for you: Cocoa Event-Handling Guide: Handling Mouse Events. This is nothing to do with Qt.
The process probably goes something like this:
- Use EventRef to get NSEvent *
- Use NSEvent to check event type and get relevant mouse information
How you do that from C++ I don't know.