diff widgets/Pane.cpp @ 89:803830f186ef

* Move matrix/fft file code to fileio (from base) * Add right-button menu to panes
author Chris Cannam
date Fri, 05 May 2006 13:06:47 +0000
parents 82482231b6b1
children 453f7da3534e
line wrap: on
line diff
--- a/widgets/Pane.cpp	Thu May 04 16:03:02 2006 +0000
+++ b/widgets/Pane.cpp	Fri May 05 13:06:47 2006 +0000
@@ -479,6 +479,11 @@
 void
 Pane::mousePressEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        emit rightButtonMenuRequested(mapToGlobal(e->pos()));
+        return;
+    }
+
     m_clickPos = e->pos();
     m_clickedInRange = true;
     m_editingSelection = Selection();
@@ -566,6 +571,10 @@
 void
 Pane::mouseReleaseEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        return;
+    }
+
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
     if (m_manager) mode = m_manager->getToolMode();
 
@@ -661,6 +670,10 @@
 void
 Pane::mouseMoveEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        return;
+    }
+
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
     if (m_manager) mode = m_manager->getToolMode();
 
@@ -814,6 +827,10 @@
 void
 Pane::mouseDoubleClickEvent(QMouseEvent *e)
 {
+    if (e->buttons() & Qt::RightButton) {
+        return;
+    }
+
     std::cerr << "mouseDoubleClickEvent" << std::endl;
 
     m_clickPos = e->pos();