]> sigrok.org Git - pulseview.git/commitdiff
Standardize on 'event' as name for all Qt events.
authorUwe Hermann <redacted>
Wed, 10 Feb 2016 20:45:37 +0000 (21:45 +0100)
committerUwe Hermann <redacted>
Sat, 13 Feb 2016 19:41:33 +0000 (20:41 +0100)
Use 'event' consistently across the whole code-base as variable name
for Qt events (previously 'e' or 'evt' was also used).

22 files changed:
pv/popups/channels.cpp
pv/popups/channels.hpp
pv/view/header.cpp
pv/view/header.hpp
pv/view/marginwidget.cpp
pv/view/marginwidget.hpp
pv/view/ruler.cpp
pv/view/ruler.hpp
pv/view/view.cpp
pv/view/view.hpp
pv/view/viewport.cpp
pv/view/viewport.hpp
pv/view/viewwidget.cpp
pv/view/viewwidget.hpp
pv/widgets/colourbutton.cpp
pv/widgets/colourbutton.hpp
pv/widgets/hidingmenubar.cpp
pv/widgets/hidingmenubar.hpp
pv/widgets/popup.cpp
pv/widgets/popup.hpp
pv/widgets/wellarray.cpp
pv/widgets/wellarray.hpp

index 1a042da8283c847abfec1efaab4c5441781cfab9..c3388581f2c402426e62a0281d61d809fa899eec 100644 (file)
@@ -209,9 +209,9 @@ QGridLayout* Channels::create_channel_group_grid(
        return grid;
 }
 
        return grid;
 }
 
-void Channels::showEvent(QShowEvent *e)
+void Channels::showEvent(QShowEvent *event)
 {
 {
-       pv::widgets::Popup::showEvent(e);
+       pv::widgets::Popup::showEvent(event);
 
        updating_channels_ = true;
 
 
        updating_channels_ = true;
 
index 62721ee177a36080d87e842668405fe1424a8c81..5ed5d4768ff18ec4fb14a86be53ed3fe10f8d422 100644 (file)
@@ -70,7 +70,7 @@ private:
                const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
 
 private:
                const std::vector< std::shared_ptr<pv::view::Signal> > sigs);
 
 private:
-       void showEvent(QShowEvent *e);
+       void showEvent(QShowEvent *event);
 
 private Q_SLOTS:
        void on_channel_checked(QWidget *widget);
 
 private Q_SLOTS:
        void on_channel_checked(QWidget *widget);
index 1977d05340fb0b63db4d87340148edc3baf478c4..ba0f9e61affba6c9314dfd66437142f99b6ce296 100644 (file)
@@ -153,15 +153,15 @@ void Header::contextMenuEvent(QContextMenuEvent *event)
        menu->exec(event->globalPos());
 }
 
        menu->exec(event->globalPos());
 }
 
-void Header::keyPressEvent(QKeyEvent *e)
+void Header::keyPressEvent(QKeyEvent *event)
 {
 {
-       assert(e);
+       assert(event);
 
 
-       MarginWidget::keyPressEvent(e);
+       MarginWidget::keyPressEvent(event);
 
 
-       if (e->key() == Qt::Key_G && e->modifiers() == Qt::ControlModifier)
+       if (event->key() == Qt::Key_G && event->modifiers() == Qt::ControlModifier)
                on_group();
                on_group();
-       else if (e->key() == Qt::Key_U && e->modifiers() == Qt::ControlModifier)
+       else if (event->key() == Qt::Key_U && event->modifiers() == Qt::ControlModifier)
                on_ungroup();
 }
 
                on_ungroup();
 }
 
index ade6d330affb57b3db9a616541fb97407b6f3a83..deb984d0dee90585c8661d2118ce3e652ccdc29a 100644 (file)
@@ -80,7 +80,7 @@ private:
 private:
        void contextMenuEvent(QContextMenuEvent *event);
 
 private:
        void contextMenuEvent(QContextMenuEvent *event);
 
-       void keyPressEvent(QKeyEvent *e);
+       void keyPressEvent(QKeyEvent *event);
 
 private Q_SLOTS:
        void on_group();
 
 private Q_SLOTS:
        void on_group();
index 0d657611021dd3fdd8e58fd0b39ef64924833c46..7e4fcdfa76aed109e0e8bfb6cb2032f6690bbdb6 100644 (file)
@@ -62,11 +62,11 @@ void MarginWidget::contextMenuEvent(QContextMenuEvent *event)
                menu->exec(event->globalPos());
 }
 
                menu->exec(event->globalPos());
 }
 
-void MarginWidget::keyPressEvent(QKeyEvent *e)
+void MarginWidget::keyPressEvent(QKeyEvent *event)
 {
 {
-       assert(e);
+       assert(event);
 
 
-       if (e->key() == Qt::Key_Delete) {
+       if (event->key() == Qt::Key_Delete) {
                const auto items = this->items();
                for (auto &i : items)
                        if (i->selected())
                const auto items = this->items();
                for (auto &i : items)
                        if (i->selected())
index 963d71712ac67a22e9ecdb77eb01c51fce3e1dc7..455aaf970aed35c734269ebd08ba03f8d6edf74a 100644 (file)
@@ -63,7 +63,7 @@ protected:
 protected:
        virtual void contextMenuEvent(QContextMenuEvent *event);
 
 protected:
        virtual void contextMenuEvent(QContextMenuEvent *event);
 
-       virtual void keyPressEvent(QKeyEvent *e);
+       virtual void keyPressEvent(QKeyEvent *event);
 };
 
 } // namespace view
 };
 
 } // namespace view
index 31ec121d074aa724bd4a67b83c2c4272d233099c..f6ec4ac78d7d142a486d2347287bd4693816ca5c 100644 (file)
@@ -225,9 +225,9 @@ Ruler::TickPositions Ruler::calculate_tick_positions(
        return tp;
 }
 
        return tp;
 }
 
-void Ruler::mouseDoubleClickEvent(QMouseEvent *e)
+void Ruler::mouseDoubleClickEvent(QMouseEvent *event)
 {
 {
-       view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
+       view_.add_flag(view_.offset() + ((double)event->x() + 0.5) * view_.scale());
 }
 
 void Ruler::draw_hover_mark(QPainter &p, int text_height)
 }
 
 void Ruler::draw_hover_mark(QPainter &p, int text_height)
index aabbe486cd8a93f8d3b986a26150aee4f40f739c..923cceb5fc3d37abb998d239ae8e490ab9e5d027 100644 (file)
@@ -122,7 +122,7 @@ private:
 
        void paintEvent(QPaintEvent *event) override;
 
 
        void paintEvent(QPaintEvent *event) override;
 
-       void mouseDoubleClickEvent(QMouseEvent *e) override;
+       void mouseDoubleClickEvent(QMouseEvent *event) override;
 
        /**
         * Draw a hover arrow under the cursor position.
 
        /**
         * Draw a hover arrow under the cursor position.
index 6ad7dea0822c0d6653a75b6b0ee2dd1e86a07e8b..9a46bab8c4c4d41ea9f91e36b05d84c96c05b9c7 100644 (file)
@@ -826,9 +826,9 @@ bool View::eventFilter(QObject *object, QEvent *event)
        return QObject::eventFilter(object, event);
 }
 
        return QObject::eventFilter(object, event);
 }
 
-bool View::viewportEvent(QEvent *e)
+bool View::viewportEvent(QEvent *event)
 {
 {
-       switch (e->type()) {
+       switch (event->type()) {
        case QEvent::Paint:
        case QEvent::MouseButtonPress:
        case QEvent::MouseButtonRelease:
        case QEvent::Paint:
        case QEvent::MouseButtonPress:
        case QEvent::MouseButtonRelease:
@@ -840,7 +840,7 @@ bool View::viewportEvent(QEvent *e)
        case QEvent::TouchEnd:
                return false;
        default:
        case QEvent::TouchEnd:
                return false;
        default:
-               return QAbstractScrollArea::viewportEvent(e);
+               return QAbstractScrollArea::viewportEvent(event);
        }
 }
 
        }
 }
 
index 635273dae74ad6e1131a592da699beba6a8e76e7..09f3c2ee020f25befb08f6c954434df11a7676f2 100644 (file)
@@ -300,9 +300,9 @@ private:
 
        bool eventFilter(QObject *object, QEvent *event);
 
 
        bool eventFilter(QObject *object, QEvent *event);
 
-       bool viewportEvent(QEvent *e);
+       bool viewportEvent(QEvent *event);
 
 
-       void resizeEvent(QResizeEvent *e);
+       void resizeEvent(QResizeEvent *event);
 
 public:
        void row_item_appearance_changed(bool label, bool content);
 
 public:
        void row_item_appearance_changed(bool label, bool content);
index 9e136664f5078b1510dbef92d57c972b61d981ba..6e07a2a8baa48a7ba0f0286e867235aad701873c 100644 (file)
@@ -202,24 +202,24 @@ void Viewport::mouseDoubleClickEvent(QMouseEvent *event)
                view_.zoom(-2.0, event->x());
 }
 
                view_.zoom(-2.0, event->x());
 }
 
-void Viewport::wheelEvent(QWheelEvent *e)
+void Viewport::wheelEvent(QWheelEvent *event)
 {
 {
-       assert(e);
+       assert(event);
 
 
-       if (e->orientation() == Qt::Vertical) {
-               if (e->modifiers() & Qt::ControlModifier) {
+       if (event->orientation() == Qt::Vertical) {
+               if (event->modifiers() & Qt::ControlModifier) {
                        // Vertical scrolling with the control key pressed
                        // is intrepretted as vertical scrolling
                        view_.set_v_offset(-view_.owner_visual_v_offset() -
                        // Vertical scrolling with the control key pressed
                        // is intrepretted as vertical scrolling
                        view_.set_v_offset(-view_.owner_visual_v_offset() -
-                               (e->delta() * height()) / (8 * 120));
+                               (event->delta() * height()) / (8 * 120));
                } else {
                        // Vertical scrolling is interpreted as zooming in/out
                } else {
                        // Vertical scrolling is interpreted as zooming in/out
-                       view_.zoom(e->delta() / 120, e->x());
+                       view_.zoom(event->delta() / 120, event->x());
                }
                }
-       } else if (e->orientation() == Qt::Horizontal) {
+       } else if (event->orientation() == Qt::Horizontal) {
                // Horizontal scrolling is interpreted as moving left/right
                view_.set_scale_offset(view_.scale(),
                // Horizontal scrolling is interpreted as moving left/right
                view_.set_scale_offset(view_.scale(),
-                       e->delta() * view_.scale() + view_.offset());
+                       event->delta() * view_.scale() + view_.offset());
        }
 }
 
        }
 }
 
index cde9f3f57673dc9df71aded63ccfe8617c98245e..e4c504215d7f266b21ad5c741bb4b90629afa248 100644 (file)
@@ -92,8 +92,8 @@ private:
 private:
        void paintEvent(QPaintEvent *event);
 
 private:
        void paintEvent(QPaintEvent *event);
 
-       void mouseDoubleClickEvent(QMouseEvent * event);
-       void wheelEvent(QWheelEvent *e);
+       void mouseDoubleClickEvent(QMouseEvent *event);
+       void wheelEvent(QWheelEvent *event);
 
 private:
        boost::optional<pv::util::Timestamp> drag_offset_;
 
 private:
        boost::optional<pv::util::Timestamp> drag_offset_;
index 30d96eb356259c9669bbfdd243f27db066d4ebfe..79326d2a10a06742a3a2639a6cbd88376d06a704 100644 (file)
@@ -223,9 +223,10 @@ void ViewWidget::mouse_left_release_event(QMouseEvent *event)
        item_dragging_ = false;
 }
 
        item_dragging_ = false;
 }
 
-bool ViewWidget::touch_event(QTouchEvent *e)
+bool ViewWidget::touch_event(QTouchEvent *event)
 {
 {
-       (void)e;
+       (void)event;
+
        return false;
 }
 
        return false;
 }
 
@@ -267,16 +268,16 @@ void ViewWidget::mouseReleaseEvent(QMouseEvent *event)
        mouse_down_item_ = nullptr;
 }
 
        mouse_down_item_ = nullptr;
 }
 
-void ViewWidget::mouseMoveEvent(QMouseEvent *e)
+void ViewWidget::mouseMoveEvent(QMouseEvent *event)
 {
 {
-       assert(e);
-       mouse_point_ = e->pos();
+       assert(event);
+       mouse_point_ = event->pos();
 
 
-       if (!e->buttons())
-               item_hover(get_mouse_over_item(e->pos()));
-       else if (e->buttons() & Qt::LeftButton) {
+       if (!event->buttons())
+               item_hover(get_mouse_over_item(event->pos()));
+       else if (event->buttons() & Qt::LeftButton) {
                if (!item_dragging_) {
                if (!item_dragging_) {
-                       if ((e->pos() - mouse_down_point_).manhattanLength() <
+                       if ((event->pos() - mouse_down_point_).manhattanLength() <
                                QApplication::startDragDistance())
                                return;
 
                                QApplication::startDragDistance())
                                return;
 
@@ -287,7 +288,7 @@ void ViewWidget::mouseMoveEvent(QMouseEvent *e)
                }
 
                // Do the drag
                }
 
                // Do the drag
-               drag_items(e->pos() - mouse_down_point_);
+               drag_items(event->pos() - mouse_down_point_);
        }
 }
 
        }
 }
 
index 7051c66608792bb1304cdeb03193dda3380dca76..fade3d289ab1e687ce511afd9c960337b9e75ef3 100644 (file)
@@ -121,14 +121,14 @@ protected:
         * Handles touch begin update and end events.
         * @param e the event that triggered this handler.
         */
         * Handles touch begin update and end events.
         * @param e the event that triggered this handler.
         */
-       virtual bool touch_event(QTouchEvent *e);
+       virtual bool touch_event(QTouchEvent *event);
 
 protected:
        bool event(QEvent *event);
 
 
 protected:
        bool event(QEvent *event);
 
-       void mousePressEvent(QMouseEvent * event);
+       void mousePressEvent(QMouseEvent *event);
        void mouseReleaseEvent(QMouseEvent *event);
        void mouseReleaseEvent(QMouseEvent *event);
-       void mouseMoveEvent(QMouseEvent *e);
+       void mouseMoveEvent(QMouseEvent *event);
 
        void leaveEvent(QEvent *event);
 
 
        void leaveEvent(QEvent *event);
 
index 13b9673894db39274472c9882550fd055077e0e6..fc9084be632c899d946fac6ddc434863ca2406e3 100644 (file)
@@ -90,9 +90,9 @@ void ColourButton::on_selected(int row, int col)
        selected(cur_colour_);
 }
 
        selected(cur_colour_);
 }
 
-void ColourButton::paintEvent(QPaintEvent *e)
+void ColourButton::paintEvent(QPaintEvent *event)
 {
 {
-       QPushButton::paintEvent(e);
+       QPushButton::paintEvent(event);
 
        QPainter p(this);
 
 
        QPainter p(this);
 
index 86e8e98fab6c6f2c7372f7bcd180f2513dbeb7a7..d373fc51a8d6c70b4fdd59683777c3279b4b6971 100644 (file)
@@ -47,7 +47,7 @@ public:
        void set_palette(const QColor *const palette);
 
 private:
        void set_palette(const QColor *const palette);
 
 private:
-       void paintEvent(QPaintEvent *e);
+       void paintEvent(QPaintEvent *event);
 
 private Q_SLOTS:
        void on_clicked(bool);
 
 private Q_SLOTS:
        void on_clicked(bool);
index 0da364b116c1fc59f45643feb29a8aa2d89563c2..4e50e3ba9383a707aed5a2c1db68e71d8ea0e5fb 100644 (file)
@@ -33,18 +33,18 @@ HidingMenuBar::HidingMenuBar(QWidget *parent) :
                this, SLOT(item_triggered()));
 }
 
                this, SLOT(item_triggered()));
 }
 
-void HidingMenuBar::focusOutEvent(QFocusEvent *e)
+void HidingMenuBar::focusOutEvent(QFocusEvent *event)
 {
 {
-       if (e->reason() != Qt::PopupFocusReason)
+       if (event->reason() != Qt::PopupFocusReason)
                setHidden(true);
                setHidden(true);
-       QMenuBar::focusOutEvent(e);
+       QMenuBar::focusOutEvent(event);
 }
 
 }
 
-void HidingMenuBar::keyPressEvent(QKeyEvent *e)
+void HidingMenuBar::keyPressEvent(QKeyEvent *event)
 {
 {
-       if (e->key() == Qt::Key_Escape)
+       if (event->key() == Qt::Key_Escape)
                setHidden(true);
                setHidden(true);
-       QMenuBar::keyPressEvent(e);
+       QMenuBar::keyPressEvent(event);
 }
 
 void HidingMenuBar::item_triggered()
 }
 
 void HidingMenuBar::item_triggered()
index 4cf5d16869c5ba05f5599dd4b4cf7d167264d7d3..9e75e281815f11c7e53ff479552cf5d22ad46ea1 100644 (file)
@@ -45,13 +45,13 @@ private:
         * Handles the event that the widget loses keyboard focus.
         * @param e the representation of the event details.
         */
         * Handles the event that the widget loses keyboard focus.
         * @param e the representation of the event details.
         */
-       void focusOutEvent(QFocusEvent *e);
+       void focusOutEvent(QFocusEvent *event);
 
        /**
         * Handles the event that a key is depressed.
         * @param e the representation of the event details.
         */
 
        /**
         * Handles the event that a key is depressed.
         * @param e the representation of the event details.
         */
-       void keyPressEvent(QKeyEvent *e);
+       void keyPressEvent(QKeyEvent *event);
 
 private Q_SLOTS:
        /**
 
 private Q_SLOTS:
        /**
index 17bc719130a5ef49eb9c2acdfc60c4696593a93f..73ddf99f30caaeafcf14c257f74736377c69ecdc 100644 (file)
@@ -67,14 +67,14 @@ void Popup::set_position(const QPoint point, Position pos)
                MarginWidth + ((pos == Top) ? ArrowLength : 0));
 }
 
                MarginWidth + ((pos == Top) ? ArrowLength : 0));
 }
 
-bool Popup::eventFilter(QObject *obj, QEvent *evt)
+bool Popup::eventFilter(QObject *obj, QEvent *event)
 {
        QKeyEvent *keyEvent;
 
        (void)obj;
 
 {
        QKeyEvent *keyEvent;
 
        (void)obj;
 
-       if (evt->type() == QEvent::KeyPress) {
-               keyEvent = static_cast<QKeyEvent*>(evt);
+       if (event->type() == QEvent::KeyPress) {
+               keyEvent = static_cast<QKeyEvent*>(event);
                if (keyEvent->key() == Qt::Key_Enter ||
                    keyEvent->key() == Qt::Key_Return) {
                        close();
                if (keyEvent->key() == Qt::Key_Enter ||
                    keyEvent->key() == Qt::Key_Return) {
                        close();
@@ -291,13 +291,13 @@ void Popup::resizeEvent(QResizeEvent*)
        setMask(popup_region());
 }
 
        setMask(popup_region());
 }
 
-void Popup::mouseReleaseEvent(QMouseEvent *e)
+void Popup::mouseReleaseEvent(QMouseEvent *event)
 {
 {
-       assert(e);
+       assert(event);
 
        // We need our own out-of-bounds click handler because QWidget counts
        // the drop-shadow region as inside the widget
 
        // We need our own out-of-bounds click handler because QWidget counts
        // the drop-shadow region as inside the widget
-       if (!bubble_rect().contains(e->pos()))
+       if (!bubble_rect().contains(event->pos()))
                close();
 }
 
                close();
 }
 
index c6f931f69c1496141154198c57ee1087ece36be6..84def1fe90eee3171a4914a0cc4157e47c85de5d 100644 (file)
@@ -52,7 +52,7 @@ public:
 
        void set_position(const QPoint point, Position pos);
 
 
        void set_position(const QPoint point, Position pos);
 
-       bool eventFilter(QObject *obj, QEvent *evt);
+       bool eventFilter(QObject *obj, QEvent *event);
 
        void show();
 
 
        void show();
 
@@ -78,10 +78,10 @@ private:
 
        void resizeEvent(QResizeEvent*);
 
 
        void resizeEvent(QResizeEvent*);
 
-       void mouseReleaseEvent(QMouseEvent *e);
+       void mouseReleaseEvent(QMouseEvent *event);
 
 protected:
 
 protected:
-       void showEvent(QShowEvent *e);
+       void showEvent(QShowEvent *);
 
 Q_SIGNALS:
        void closed();
 
 Q_SIGNALS:
        void closed();
index ad29b039657d8123de5f49c3ba4b2ec76d9559dc..1351467a122a7bc8c5bcd36e23ef7fd4192a6638 100644 (file)
@@ -49,9 +49,9 @@
 namespace pv {
 namespace widgets {
 
 namespace pv {
 namespace widgets {
 
-void WellArray::paintEvent(QPaintEvent *e)
+void WellArray::paintEvent(QPaintEvent *event)
 {
 {
-    QRect r = e->rect();
+    QRect r = event->rect();
     int cx = r.x();
     int cy = r.y();
     int ch = r.height();
     int cx = r.x();
     int cy = r.y();
     int ch = r.height();
@@ -163,10 +163,10 @@ void WellArray::paintCellContents(QPainter *p, int row, int col, const QRect &r)
     }
 }
 
     }
 }
 
-void WellArray::mousePressEvent(QMouseEvent *e)
+void WellArray::mousePressEvent(QMouseEvent *event)
 {
     // The current cell marker is set to the cell the mouse is pressed in
 {
     // The current cell marker is set to the cell the mouse is pressed in
-    QPoint pos = e->pos();
+    QPoint pos = event->pos();
     setCurrent(rowAt(pos.y()), columnAt(pos.x()));
 }
 
     setCurrent(rowAt(pos.y()), columnAt(pos.x()));
 }
 
@@ -263,9 +263,9 @@ void WellArray::focusOutEvent(QFocusEvent*)
 
 /*\reimp
 */
 
 /*\reimp
 */
-void WellArray::keyPressEvent(QKeyEvent* e)
+void WellArray::keyPressEvent(QKeyEvent* event)
 {
 {
-    switch(e->key()) {                        // Look at the key code
+    switch(event->key()) {                        // Look at the key code
     case Qt::Key_Left:                                // If 'left arrow'-key,
         if (curCol > 0)                        // and cr't not in leftmost col
             setCurrent(curRow, curCol - 1);        // set cr't to next left column
     case Qt::Key_Left:                                // If 'left arrow'-key,
         if (curCol > 0)                        // and cr't not in leftmost col
             setCurrent(curRow, curCol - 1);        // set cr't to next left column
@@ -286,7 +286,7 @@ void WellArray::keyPressEvent(QKeyEvent* e)
         setSelected(curRow, curCol);
         break;
     default:                                // If not an interesting key,
         setSelected(curRow, curCol);
         break;
     default:                                // If not an interesting key,
-        e->ignore();                        // we don't accept the event
+        event->ignore();                        // we don't accept the event
         return;
     }
 
         return;
     }
 
index 8132eb0076c35fd69ea35154a456ead64cdb2566..32365a10dfdad79954b462249463f07cb427bbfe 100644 (file)
@@ -119,7 +119,7 @@ protected:
     void keyPressEvent(QKeyEvent*);
     void focusInEvent(QFocusEvent*);
     void focusOutEvent(QFocusEvent*);
     void keyPressEvent(QKeyEvent*);
     void focusInEvent(QFocusEvent*);
     void focusOutEvent(QFocusEvent*);
-    void paintEvent(QPaintEvent *);
+    void paintEvent(QPaintEvent*);
 
 private:
     Q_DISABLE_COPY(WellArray)
 
 private:
     Q_DISABLE_COPY(WellArray)