return (first_->get_x() + second_->get_x()) / 2.0f;
}
-QPoint CursorPair::point(const QRect &rect) const
+QPoint CursorPair::drag_point(const QRect &rect) const
{
- return first_->point(rect);
+ return first_->drag_point(rect);
}
pv::widgets::Popup* CursorPair::create_popup(QWidget *parent)
float get_x() const override;
- QPoint point(const QRect &rect) const override;
+ QPoint drag_point(const QRect &rect) const override;
pv::widgets::Popup* create_popup(QWidget *parent) override;
Popup *const popup = TimeMarker::create_popup(parent);
popup->set_position(parent->mapToGlobal(
- point(parent->rect())), Popup::Bottom);
+ drag_point(parent->rect())), Popup::Bottom);
QFormLayout *const form = (QFormLayout*)popup->layout();
stable_sort(items.begin(), items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
- return a->point(QRect()).y() < b->point(QRect()).y(); });
+ return a->drag_point(QRect()).y() < b->drag_point(QRect()).y(); });
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
owner_.owner()->row_item_appearance_changed(true, true);
}
-QPoint SignalScaleHandle::point(const QRect &rect) const
+QPoint SignalScaleHandle::drag_point(const QRect &rect) const
{
- return owner_.point(rect) + QPoint(0, owner_.scale_handle_offset());
+ return owner_.drag_point(rect) + QPoint(0, owner_.scale_handle_offset());
}
QRectF SignalScaleHandle::hit_box_rect(const ViewItemPaintParams &pp) const
* Get the drag point.
* @param rect the rectangle of the widget area.
*/
- QPoint point(const QRect &rect) const;
+ QPoint drag_point(const QRect &rect) const;
/**
* Computes the outline rectangle of the viewport hit-box.
return roundf(((time_ - view_.offset()) / view_.scale()).convert_to<float>()) + 0.5f;
}
-QPoint TimeMarker::point(const QRect &rect) const
+QPoint TimeMarker::drag_point(const QRect &rect) const
{
return QPoint(get_x(), rect.bottom());
}
Popup *const popup = new Popup(parent);
popup->set_position(parent->mapToGlobal(
- point(parent->rect())), Popup::Bottom);
+ drag_point(parent->rect())), Popup::Bottom);
QFormLayout *const form = new QFormLayout(popup);
popup->setLayout(form);
* Gets the arrow-tip point of the time marker.
* @param rect the rectangle of the ruler area.
*/
- QPoint point(const QRect &rect) const override;
+ QPoint drag_point(const QRect &rect) const override;
/**
* Computes the outline rectangle of a label.
popup_ = new Popup(parent);
popup_->set_position(parent->mapToGlobal(
- point(parent->rect())), Popup::Right);
+ drag_point(parent->rect())), Popup::Right);
create_popup_form();
owner_->owner_visual_v_offset());
}
-QPoint TraceTreeItem::point(const QRect &rect) const
+QPoint TraceTreeItem::drag_point(const QRect &rect) const
{
return QPoint(rect.right(), get_visual_y());
}
* Gets the arrow-tip point of the row item marker.
* @param rect the rectangle of the header area.
*/
- QPoint point(const QRect &rect) const;
+ QPoint drag_point(const QRect &rect) const;
/**
* Computes the vertical extents of the contents of this row item.
return ((time_ - view_.offset()) / view_.scale()).convert_to<float>();
}
-QPoint TriggerMarker::point(const QRect &rect) const
+QPoint TriggerMarker::drag_point(const QRect &rect) const
{
return QPoint(get_x(), rect.bottom());
}
* Gets the arrow-tip point of the time marker.
* @param rect the rectangle of the ruler area.
*/
- QPoint point(const QRect &rect) const override;
+ QPoint drag_point(const QRect &rect) const override;
/**
* Paints the foreground layer of the item with a QPainter
void ViewItem::drag()
{
if (is_draggable())
- drag_point_ = point(QRect());
+ drag_point_ = drag_point(QRect());
}
void ViewItem::drag_release()
* Get the drag point.
* @param rect the rectangle of the widget area.
*/
- virtual QPoint point(const QRect &rect) const = 0;
+ virtual QPoint drag_point(const QRect &rect) const = 0;
/**
* Computes the outline rectangle of a label.
stable_sort(row_items.begin(), row_items.end(),
[](const shared_ptr<RowItem> &a, const shared_ptr<RowItem> &b) {
- return a->point(QRect()).y() < b->point(QRect()).y(); });
+ return a->drag_point(QRect()).y() < b->drag_point(QRect()).y(); });
const vector< shared_ptr<TimeItem> > time_items(view_.time_items());
assert(none_of(time_items.begin(), time_items.end(),