X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fruler.hpp;h=55c156f5942e34f8a97912322b25a3b2df4c669b;hb=20c99cfc69d3c7430817abd9a1f810698deb4a18;hp=5035bfc83bffc9962f8a7d06d782c1fae5dcd232;hpb=66279897e318a2549557054d1204c862f7d99469;p=pulseview.git diff --git a/pv/views/trace/ruler.hpp b/pv/views/trace/ruler.hpp index 5035bfc8..55c156f5 100644 --- a/pv/views/trace/ruler.hpp +++ b/pv/views/trace/ruler.hpp @@ -17,8 +17,8 @@ * along with this program; if not, see . */ -#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP -#define PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP +#ifndef PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP +#define PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP #include #include @@ -120,9 +120,15 @@ public: pv::util::Timestamp get_absolute_time_from_x_pos(uint32_t x) const; pv::util::Timestamp get_ruler_time_from_x_pos(uint32_t x) const; + pv::util::Timestamp get_ruler_time_from_absolute_time(const pv::util::Timestamp& abs_time) const; + pv::util::Timestamp get_absolute_time_from_ruler_time(const pv::util::Timestamp& ruler_time) const; + + shared_ptr get_reference_item() const; + protected: virtual void contextMenuEvent(QContextMenuEvent *event) override; void resizeEvent(QResizeEvent*) override; + virtual void item_hover(const shared_ptr &item, QPoint pos) override; private: /** @@ -178,6 +184,7 @@ private Q_SLOTS: void on_createMarker(); void on_setZeroPosition(); + void on_resetZeroPosition(); void on_toggleHoverMarker(); private: @@ -187,6 +194,8 @@ private: */ boost::optional tick_position_cache_; + shared_ptr hover_item_; + uint32_t context_menu_x_pos_; }; @@ -194,4 +203,4 @@ private: } // namespace views } // namespace pv -#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP +#endif // PULSEVIEW_PV_VIEWS_TRACE_RULER_HPP