{
assert(e);
- if (e->key() == Qt::Key_Delete)
- {
- for (const shared_ptr<RowItem> r : view_)
- if (r->selected())
- r->delete_pressed();
- }
- else if (e->key() == Qt::Key_G && e->modifiers() == Qt::ControlModifier)
+ MarginWidget::keyPressEvent(e);
+
+ if (e->key() == Qt::Key_G && e->modifiers() == Qt::ControlModifier)
on_group();
else if (e->key() == Qt::Key_U && e->modifiers() == Qt::ControlModifier)
on_ungroup();
menu->exec(event->globalPos());
}
+void MarginWidget::keyPressEvent(QKeyEvent *e)
+{
+ assert(e);
+
+ if (e->key() == Qt::Key_Delete)
+ {
+ const auto items = this->items();
+ for (auto &i : items)
+ if (i->selected())
+ i->delete_pressed();
+ }
+}
+
void MarginWidget::clear_selection()
{
const auto items = this->items();
*/
void mouse_left_press_event(QMouseEvent *event);
-private:
+protected:
void mousePressEvent(QMouseEvent * event);
void leaveEvent(QEvent *event);
virtual void contextMenuEvent(QContextMenuEvent *event);
+ virtual void keyPressEvent(QKeyEvent *e);
+
public Q_SLOTS:
void clear_selection();
view_.add_flag(view_.offset() + ((double)e->x() + 0.5) * view_.scale());
}
-void Ruler::keyPressEvent(QKeyEvent *e)
-{
- assert(e);
-
- if (e->key() == Qt::Key_Delete)
- {
- const vector< shared_ptr<TimeItem> > items(view_.time_items());
- for (auto &i : items)
- if (i->selected())
- i->delete_pressed();
- }
-}
-
void Ruler::draw_hover_mark(QPainter &p, int text_height)
{
const int x = view_.hover_point().x();
void mouseDoubleClickEvent(QMouseEvent *e);
- void keyPressEvent(QKeyEvent *e);
-
private:
/**
* Draw a hover arrow under the cursor position.