non-windows: fake mouse right release event
This commit is contained in:
parent
79d38796c4
commit
456038b5ce
1 changed files with 7 additions and 6 deletions
|
@ -957,13 +957,14 @@ using namespace ImageUtils;
|
||||||
|
|
||||||
void SceneViewer::contextMenuEvent(QContextMenuEvent *e)
|
void SceneViewer::contextMenuEvent(QContextMenuEvent *e)
|
||||||
{
|
{
|
||||||
|
#ifndef WIN32
|
||||||
|
/* On windows the widget receive the release event before the menu
|
||||||
|
is shown, on linux and osx the release event is lost, never
|
||||||
|
received by the widget */
|
||||||
|
QMouseEvent fakeRelease(QEvent::MouseButtonRelease, e->pos(),
|
||||||
|
Qt::RightButton, Qt::NoButton, Qt::NoModifier);
|
||||||
|
|
||||||
#ifdef MACOSX
|
QApplication::instance()->sendEvent(this, &fakeRelease);
|
||||||
//cleaning-up mousePressedEvent on MacOSX instead of mouseReleaseEvent called
|
|
||||||
m_mouseButton = Qt::NoButton;
|
|
||||||
m_tabletEvent = false;
|
|
||||||
m_pressure = 0;
|
|
||||||
m_buttonClicked = false;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (m_freezedStatus != NO_FREEZED)
|
if (m_freezedStatus != NO_FREEZED)
|
||||||
|
|
Loading…
Reference in a new issue