X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fwidgets%2Fwellarray.cpp;h=04a7ccec9723c999cea7b23bae94db1a25c03eee;hp=1f3bf69825ac7434a0a7e4a7b612342b6b9e4dce;hb=dbed5609ae31cdfc3e9db10f3ab91b7607c08372;hpb=f32905530347e1020d5ce7959123cf797c9a4829 diff --git a/pv/widgets/wellarray.cpp b/pv/widgets/wellarray.cpp index 1f3bf698..04a7ccec 100644 --- a/pv/widgets/wellarray.cpp +++ b/pv/widgets/wellarray.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include #include +#include #include #include @@ -49,9 +49,9 @@ 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(); @@ -104,7 +104,7 @@ WellArray::WellArray(int rows, int cols, QWidget *parent) : QWidget(parent) ,nrows(rows), ncols(cols) { - d = 0; + d = nullptr; setFocusPolicy(Qt::StrongFocus); cellw = 28; cellh = 24; @@ -125,7 +125,7 @@ void WellArray::paintCell(QPainter* p, int row, int col, const QRect &rect) { int b = 3; //margin - const QPalette & g = palette(); + const QPalette& g = palette(); QStyleOptionFrame opt; int dfw = style()->pixelMetric(QStyle::PM_DefaultFrameWidth); opt.lineWidth = dfw; @@ -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 - QPoint pos = e->pos(); + QPoint pos = event->pos(); setCurrent(rowAt(pos.y()), columnAt(pos.x())); } @@ -220,7 +220,7 @@ void WellArray::setSelected(int row, int col) updateCell(oldRow, oldCol); updateCell(selRow, selCol); if (row >= 0) - Q_EMIT selected(row, col); + selected(row, col); } void WellArray::focusInEvent(QFocusEvent*) @@ -263,9 +263,9 @@ void WellArray::focusOutEvent(QFocusEvent*) /*\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 @@ -286,11 +286,11 @@ void WellArray::keyPressEvent(QKeyEvent* e) 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; } } -} // namespace wellarray +} // namespace widgets } // namespace pv