PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::views::trace::TimeMarker Class Referenceabstract

#include <timemarker.hpp>

Inheritance diagram for pv::views::trace::TimeMarker:
Collaboration diagram for pv::views::trace::TimeMarker:

Public Member Functions

virtual const pv::util::Timestamp time () const override
 
void set_time (const pv::util::Timestamp &time) override
 
float get_x () const override
 
QPoint drag_point (const QRect &rect) const override
 
QRectF label_rect (const QRectF &rect) const override
 
QRectF hit_box_rect (const ViewItemPaintParams &pp) const override
 
virtual QString get_display_text () const
 
virtual QString get_text () const =0
 
virtual void set_text (const QString &text)
 
void paint_label (QPainter &p, const QRect &rect, bool hover) override
 
void paint_fore (QPainter &p, ViewItemPaintParams &pp) override
 
virtual pv::widgets::Popupcreate_popup (QWidget *parent) override
 
- Public Member Functions inherited from pv::views::trace::TimeItem
virtual const pv::util::Timestamp delta (const pv::util::Timestamp &other) const
 
void drag_by (const QPoint &delta)
 
bool is_snapping_disabled () const
 
- Public Member Functions inherited from pv::views::trace::ViewItem
 ViewItem ()
 
virtual bool enabled () const =0
 
virtual bool is_selectable (QPoint pos) const
 
bool selected () const
 
virtual void select (bool select=true)
 
virtual bool is_draggable (QPoint pos) const
 
bool dragging () const
 
void drag ()
 
virtual void drag_release ()
 
virtual void paint_back (QPainter &p, ViewItemPaintParams &pp)
 
virtual void paint_mid (QPainter &p, ViewItemPaintParams &pp)
 
virtual QMenu * create_header_context_menu (QWidget *parent)
 
virtual QMenu * create_view_context_menu (QWidget *parent, QPoint &click_pos)
 
virtual void delete_pressed ()
 
virtual void hover_point_changed (const QPoint &hp)
 
virtual void mouse_left_press_event (const QMouseEvent *event)
 

Static Public Attributes

static const int ArrowSize = 4
 
- Static Public Attributes inherited from pv::views::trace::ViewItem
static const QSizeF LabelPadding
 
static const int HighlightRadius = 3
 

Protected Member Functions

 TimeMarker (View &view, const QColor &color, const pv::util::Timestamp &time)
 
- Protected Member Functions inherited from pv::views::trace::TimeItem
 TimeItem (View &view)
 

Protected Attributes

const QColor & color_
 
pv::util::Timestamp time_
 
QSizeF text_size_
 
QWidgetAction * value_action_
 
pv::widgets::TimestampSpinBoxvalue_widget_
 
- Protected Attributes inherited from pv::views::trace::TimeItem
bool snapping_disabled_ = false
 
Viewview_
 
- Protected Attributes inherited from pv::views::trace::ViewItem
QWidget * context_parent_
 
QPoint drag_point_
 

Private Slots

void on_popup_closed ()
 
void on_value_changed (const pv::util::Timestamp &value)
 

Additional Inherited Members

- Static Public Member Functions inherited from pv::views::trace::ViewItem
static QColor select_text_color (QColor background)
 
- Static Protected Member Functions inherited from pv::views::trace::ViewItem
static QPen highlight_pen ()
 

Detailed Description

The TimeMarker class represents items on the Ruler that highlight a single point in time to the user. Aside from this, it is generic in nature.

Definition at line 48 of file timemarker.hpp.

Constructor & Destructor Documentation

pv::views::trace::TimeMarker::TimeMarker ( View view,
const QColor &  color,
const pv::util::Timestamp time 
)
protected

Constructor.

Parameters
viewA reference to the view that owns this marker.
colorA reference to the color of this cursor.
timeThe time to set the flag to.

Definition at line 47 of file timemarker.cpp.

Member Function Documentation

pv::widgets::Popup * pv::views::trace::TimeMarker::create_popup ( QWidget *  parent)
overridevirtual

Reimplemented from pv::views::trace::ViewItem.

Reimplemented in pv::views::trace::Flag.

Definition at line 179 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QPoint pv::views::trace::TimeMarker::drag_point ( const QRect &  rect) const
overridevirtual

Gets the arrow-tip point of the time marker.

Parameters
rectthe rectangle of the ruler area.

Implements pv::views::trace::ViewItem.

Definition at line 80 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString pv::views::trace::TimeMarker::get_display_text ( ) const
virtual

Gets the current text to show in the marker - this may be dynamic.

Reimplemented in pv::views::trace::Flag.

Definition at line 108 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual QString pv::views::trace::TimeMarker::get_text ( ) const
pure virtual

Gets the default text used to show the marker - e.g. the user-editable name.

Implemented in pv::views::trace::Flag, and pv::views::trace::Cursor.

Here is the caller graph for this function:

float pv::views::trace::TimeMarker::get_x ( ) const
overridevirtual

Implements pv::views::trace::TimeItem.

Definition at line 74 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QRectF pv::views::trace::TimeMarker::hit_box_rect ( const ViewItemPaintParams pp) const
overridevirtual

Computes the outline rectangle of the viewport hit-box.

Parameters
rectthe rectangle of the viewport area.
Returns
Returns the rectangle of the hit-box.

Reimplemented from pv::views::trace::ViewItem.

Definition at line 101 of file timemarker.cpp.

Here is the call graph for this function:

QRectF pv::views::trace::TimeMarker::label_rect ( const QRectF &  rect) const
overridevirtual

Computes the outline rectangle of a label.

Parameters
rectthe rectangle of the header area.
Returns
Returns the rectangle of the signal label.

Reimplemented from pv::views::trace::ViewItem.

Definition at line 87 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::TimeMarker::on_popup_closed ( )
privateslot

Definition at line 203 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::TimeMarker::on_value_changed ( const pv::util::Timestamp value)
privateslot

Definition at line 210 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::TimeMarker::paint_fore ( QPainter &  p,
ViewItemPaintParams pp 
)
overridevirtual

Paints the foreground layer of the item with a QPainter

Parameters
pthe QPainter to paint into.
ppthe painting parameters object to paint with.

Reimplemented from pv::views::trace::ViewItem.

Definition at line 169 of file timemarker.cpp.

Here is the call graph for this function:

void pv::views::trace::TimeMarker::paint_label ( QPainter &  p,
const QRect &  rect,
bool  hover 
)
overridevirtual

Paints the marker's label to the ruler.

Parameters
pThe painter to draw with.
rectThe rectangle of the ruler client area.
hovertrue if the label is being hovered over by the mouse.

Reimplemented from pv::views::trace::ViewItem.

Definition at line 118 of file timemarker.cpp.

Here is the call graph for this function:

void pv::views::trace::TimeMarker::set_text ( const QString &  text)
virtual

Sets the text to show in the marker.

Reimplemented in pv::views::trace::Flag.

Definition at line 113 of file timemarker.cpp.

void pv::views::trace::TimeMarker::set_time ( const pv::util::Timestamp time)
overridevirtual

Sets the time of the marker.

Implements pv::views::trace::TimeItem.

Definition at line 62 of file timemarker.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

const pv::util::Timestamp pv::views::trace::TimeMarker::time ( ) const
overridevirtual

Gets the time of the marker.

Implements pv::views::trace::TimeItem.

Definition at line 57 of file timemarker.cpp.

Here is the caller graph for this function:

Member Data Documentation

const int pv::views::trace::TimeMarker::ArrowSize = 4
static

Definition at line 53 of file timemarker.hpp.

const QColor& pv::views::trace::TimeMarker::color_
protected

Definition at line 136 of file timemarker.hpp.

QSizeF pv::views::trace::TimeMarker::text_size_
protected

Definition at line 140 of file timemarker.hpp.

pv::util::Timestamp pv::views::trace::TimeMarker::time_
protected

Definition at line 138 of file timemarker.hpp.

QWidgetAction* pv::views::trace::TimeMarker::value_action_
protected

Definition at line 142 of file timemarker.hpp.

pv::widgets::TimestampSpinBox* pv::views::trace::TimeMarker::value_widget_
protected

Definition at line 143 of file timemarker.hpp.


The documentation for this class was generated from the following files: