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;
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);
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();
- else if (e->key() == Qt::Key_U && e->modifiers() == Qt::ControlModifier)
+ else if (event->key() == Qt::Key_U && event->modifiers() == Qt::ControlModifier)
on_ungroup();
}
private:
void contextMenuEvent(QContextMenuEvent *event);
- void keyPressEvent(QKeyEvent *e);
+ void keyPressEvent(QKeyEvent *event);
private Q_SLOTS:
void on_group();
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())
protected:
virtual void contextMenuEvent(QContextMenuEvent *event);
- virtual void keyPressEvent(QKeyEvent *e);
+ virtual void keyPressEvent(QKeyEvent *event);
};
} // namespace view
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 paintEvent(QPaintEvent *event) override;
- void mouseDoubleClickEvent(QMouseEvent *e) override;
+ void mouseDoubleClickEvent(QMouseEvent *event) override;
/**
* Draw a hover arrow under the cursor position.
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::TouchEnd:
return false;
default:
- return QAbstractScrollArea::viewportEvent(e);
+ return QAbstractScrollArea::viewportEvent(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);
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() -
- (e->delta() * height()) / (8 * 120));
+ (event->delta() * height()) / (8 * 120));
} 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(),
- e->delta() * view_.scale() + view_.offset());
+ event->delta() * view_.scale() + view_.offset());
}
}
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_;
item_dragging_ = false;
}
-bool ViewWidget::touch_event(QTouchEvent *e)
+bool ViewWidget::touch_event(QTouchEvent *event)
{
- (void)e;
+ (void)event;
+
return false;
}
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 ((e->pos() - mouse_down_point_).manhattanLength() <
+ if ((event->pos() - mouse_down_point_).manhattanLength() <
QApplication::startDragDistance())
return;
}
// Do the drag
- drag_items(e->pos() - mouse_down_point_);
+ drag_items(event->pos() - mouse_down_point_);
}
}
* 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);
- void mousePressEvent(QMouseEvent * event);
+ void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *e);
+ void mouseMoveEvent(QMouseEvent *event);
void leaveEvent(QEvent *event);
selected(cur_colour_);
}
-void ColourButton::paintEvent(QPaintEvent *e)
+void ColourButton::paintEvent(QPaintEvent *event)
{
- QPushButton::paintEvent(e);
+ QPushButton::paintEvent(event);
QPainter p(this);
void set_palette(const QColor *const palette);
private:
- void paintEvent(QPaintEvent *e);
+ void paintEvent(QPaintEvent *event);
private Q_SLOTS:
void on_clicked(bool);
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);
- 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);
- QMenuBar::keyPressEvent(e);
+ QMenuBar::keyPressEvent(event);
}
void HidingMenuBar::item_triggered()
* 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.
*/
- void keyPressEvent(QKeyEvent *e);
+ void keyPressEvent(QKeyEvent *event);
private Q_SLOTS:
/**
MarginWidth + ((pos == Top) ? ArrowLength : 0));
}
-bool Popup::eventFilter(QObject *obj, QEvent *evt)
+bool Popup::eventFilter(QObject *obj, QEvent *event)
{
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();
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
- if (!bubble_rect().contains(e->pos()))
+ if (!bubble_rect().contains(event->pos()))
close();
}
void set_position(const QPoint point, Position pos);
- bool eventFilter(QObject *obj, QEvent *evt);
+ bool eventFilter(QObject *obj, QEvent *event);
void show();
void resizeEvent(QResizeEvent*);
- void mouseReleaseEvent(QMouseEvent *e);
+ void mouseReleaseEvent(QMouseEvent *event);
protected:
- void showEvent(QShowEvent *e);
+ void showEvent(QShowEvent *);
Q_SIGNALS:
void closed();
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();
}
}
-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()));
}
/*\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
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;
}
void keyPressEvent(QKeyEvent*);
void focusInEvent(QFocusEvent*);
void focusOutEvent(QFocusEvent*);
- void paintEvent(QPaintEvent *);
+ void paintEvent(QPaintEvent*);
private:
Q_DISABLE_COPY(WellArray)