X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fcursorpair.hpp;h=6728268039f5e718d7363f68b63a9b43fa55758c;hp=7a73e1980395d16b43c22420ed23bb802e6f0304;hb=581724de334181fc5338f1efa87954264cf90520;hpb=1573bf16ba50d1c023ad3a9ce596f0ab6eaeacff diff --git a/pv/views/trace/cursorpair.hpp b/pv/views/trace/cursorpair.hpp index 7a73e198..67282680 100644 --- a/pv/views/trace/cursorpair.hpp +++ b/pv/views/trace/cursorpair.hpp @@ -25,6 +25,7 @@ #include #include +#include using std::pair; using std::shared_ptr; @@ -35,11 +36,15 @@ namespace pv { namespace views { namespace trace { +class View; + class CursorPair : public TimeItem { + Q_OBJECT + private: static const int DeltaPadding; - static const QColor ViewportFillColour; + static const QColor ViewportFillColor; public: /** @@ -48,7 +53,6 @@ public: */ CursorPair(View &view); -public: /** * Returns true if the item is visible and enabled. */ @@ -71,7 +75,7 @@ public: 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; @@ -98,14 +102,17 @@ public: */ QString format_string(); - void compute_text_size(QPainter &p); - pair get_cursor_offsets() const; +public Q_SLOTS: + void on_hover_point_changed(const QWidget* widget, const QPoint &hp); + private: shared_ptr first_, second_; QSizeF text_size_; + QRectF label_area_; + bool label_incomplete_; }; } // namespace trace