return shared_ptr<RowItem>();
}
-void Header::drag_items(const QPoint &delta)
-{
- RowItemOwner *item_owner = nullptr;
- for (std::shared_ptr<RowItem> r : view_)
- if (r->dragging()) {
- item_owner = r->owner();
- r->drag_by(delta);
-
- // Ensure the trace is selected
- r->select();
- }
-
- item_owner->restack_items();
- for (const auto &r : *item_owner)
- r->animate_to_layout_v_offset();
-}
-
void Header::paintEvent(QPaintEvent*)
{
// The trace labels are not drawn with the arrows exactly on the
std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
const QPoint &pt);
- /**
- * Drag the dragging items by the delta offset.
- * @param delta the drag offset in pixels.
- */
- void drag_items(const QPoint &delta);
-
private:
void paintEvent(QPaintEvent *event);
*/
void show_popup(const std::shared_ptr<ViewItem> &item);
- /**
- * Drag the dragging items by the delta offset.
- * @param delta the drag offset in pixels.
- */
- virtual void drag_items(const QPoint &delta) = 0;
-
/**
* Handles left mouse button press events.
* @param event the mouse event that triggered this handler.
return nullptr;
}
-void Ruler::drag_items(const QPoint &delta)
-{
- const vector< shared_ptr<TimeItem> > items(view_.time_items());
- for (auto &i : items)
- if (i->dragging())
- i->drag_by(delta);
-}
-
void Ruler::paintEvent(QPaintEvent*)
{
const int ValueMargin = 3;
std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
const QPoint &pt);
- /**
- * Drag the dragging items by the delta offset.
- * @param delta the drag offset in pixels.
- */
- void drag_items(const QPoint &delta);
-
private:
void paintEvent(QPaintEvent *event);
return false;
}
+void ViewWidget::drag_items(const QPoint &delta)
+{
+ // Drag the row items
+ RowItemOwner *item_owner = nullptr;
+ for (std::shared_ptr<RowItem> r : view_)
+ if (r->dragging()) {
+ item_owner = r->owner();
+ r->drag_by(delta);
+
+ // Ensure the trace is selected
+ r->select();
+ }
+
+ if (item_owner) {
+ item_owner->restack_items();
+ for (const auto &r : *item_owner)
+ r->animate_to_layout_v_offset();
+ }
+
+ // Drag the time items
+ const vector< shared_ptr<TimeItem> > items(view_.time_items());
+ for (auto &i : items)
+ if (i->dragging())
+ i->drag_by(delta);
+}
+
} // namespace view
} // namespace pv
*/
bool accept_drag() const;
+ /**
+ * Drag the dragging items by the delta offset.
+ * @param delta the drag offset in pixels.
+ */
+ void drag_items(const QPoint &delta);
+
protected:
pv::view::View &view_;
};