]> sigrok.org Git - pulseview.git/blobdiff - pv/widgets/wellarray.cpp
Renamed C++ headers to .hpp
[pulseview.git] / pv / widgets / wellarray.cpp
index 6776e34f6b110dc7c2f457b528f6573cd08e387d..26c257acd691c20f09b3f2d665855c64c6990d66 100644 (file)
 **
 ****************************************************************************/
 
 **
 ****************************************************************************/
 
-#define QT_NO_MENU
-
 #include <QPainter>
 #include <QPaintEvent>
 #include <QStyle>
 #include <QStyleOptionFrame>
 
 #include <QPainter>
 #include <QPaintEvent>
 #include <QStyle>
 #include <QStyleOptionFrame>
 
-#include "wellarray.h"
+#include "wellarray.hpp"
 
 void QWellArray::paintEvent(QPaintEvent *e)
 {
 
 void QWellArray::paintEvent(QPaintEvent *e)
 {
@@ -219,12 +217,7 @@ void QWellArray::setSelected(int row, int col)
     updateCell(oldRow, oldCol);
     updateCell(selRow, selCol);
     if (row >= 0)
     updateCell(oldRow, oldCol);
     updateCell(selRow, selCol);
     if (row >= 0)
-        emit selected(row, col);
-
-#ifndef QT_NO_MENU
-    if (isVisible() && qobject_cast<QMenu*>(parentWidget()))
-        parentWidget()->close();
-#endif
+        Q_EMIT selected(row, col);
 }
 
 void QWellArray::focusInEvent(QFocusEvent*)
 }
 
 void QWellArray::focusInEvent(QFocusEvent*)
@@ -286,17 +279,6 @@ void QWellArray::keyPressEvent(QKeyEvent* e)
         if(curRow < numRows()-1)
             setCurrent(curRow + 1, curCol);
         break;
         if(curRow < numRows()-1)
             setCurrent(curRow + 1, curCol);
         break;
-#if 0
-    // bad idea that shouldn't have been implemented; very counterintuitive
-    case Qt::Key_Return:
-    case Qt::Key_Enter:
-        /*
-          ignore the key, so that the dialog get it, but still select
-          the current row/col
-        */
-        e->ignore();
-        // fallthrough intended
-#endif
     case Qt::Key_Space:
         setSelected(curRow, curCol);
         break;
     case Qt::Key_Space:
         setSelected(curRow, curCol);
         break;