PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::views::trace::CursorPair Class Reference

#include <cursorpair.hpp>

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

Public Slots

void on_hover_point_changed (const QWidget *widget, const QPoint &hp)
 

Public Member Functions

 CursorPair (View &view)
 
 ~CursorPair ()
 
bool enabled () const override
 
shared_ptr< Cursorfirst () const
 
shared_ptr< Cursorsecond () const
 
void set_time (const pv::util::Timestamp &time) override
 
virtual const pv::util::Timestamp time () const override
 
float get_x () const override
 
virtual const pv::util::Timestamp delta (const pv::util::Timestamp &other) const override
 
QPoint drag_point (const QRect &rect) const override
 
pv::widgets::Popupcreate_popup (QWidget *parent) override
 
QMenu * create_header_context_menu (QWidget *parent) override
 
QRectF label_rect (const QRectF &rect) const override
 
void paint_label (QPainter &p, const QRect &rect, bool hover) override
 
void paint_back (QPainter &p, ViewItemPaintParams &pp) override
 
QString format_string (int max_width=0, std::function< double(const QString &)> query_size=[](const QString &s) -> double{(void) s;return 0;})
 
pair< float, float > get_cursor_offsets () const
 
virtual void on_setting_changed (const QString &key, const QVariant &value) override
 
- Public Member Functions inherited from pv::views::trace::TimeItem
void drag_by (const QPoint &delta)
 
bool is_snapping_disabled () const
 
- Public Member Functions inherited from pv::views::trace::ViewItem
 ViewItem ()
 
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 QRectF hit_box_rect (const ViewItemPaintParams &pp) const
 
virtual void paint_mid (QPainter &p, ViewItemPaintParams &pp)
 
virtual void paint_fore (QPainter &p, ViewItemPaintParams &pp)
 
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)
 

Private Member Functions

QString format_string_sub (int time_precision, int freq_precision, bool show_unit=true)
 

Private Attributes

shared_ptr< Cursorfirst_
 
shared_ptr< Cursorsecond_
 
QColor fill_color_
 
QSizeF text_size_
 
QRectF label_area_
 
bool label_incomplete_
 
bool show_interval_
 
bool show_frequency_
 
bool show_samples_
 

Static Private Attributes

static const int DeltaPadding = 8
 

Additional Inherited Members

- Static Public Member Functions inherited from pv::views::trace::ViewItem
static QColor select_text_color (QColor background)
 
- Static Public Attributes inherited from pv::views::trace::ViewItem
static const QSizeF LabelPadding
 
static const int HighlightRadius = 3
 
- Protected Member Functions inherited from pv::views::trace::TimeItem
 TimeItem (View &view)
 
- Static Protected Member Functions inherited from pv::views::trace::ViewItem
static QPen highlight_pen ()
 
- 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_
 

Detailed Description

Definition at line 43 of file cursorpair.hpp.

Constructor & Destructor Documentation

pv::views::trace::CursorPair::CursorPair ( View view)

Constructor.

Parameters
viewA reference to the view that owns this cursor pair.

Definition at line 46 of file cursorpair.cpp.

Here is the call graph for this function:

pv::views::trace::CursorPair::~CursorPair ( )

Definition at line 68 of file cursorpair.cpp.

Here is the call graph for this function:

Member Function Documentation

QMenu * pv::views::trace::CursorPair::create_header_context_menu ( QWidget *  parent)
overridevirtual

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

Definition at line 124 of file cursorpair.cpp.

Here is the call graph for this function:

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

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

Definition at line 118 of file cursorpair.cpp.

const pv::util::Timestamp pv::views::trace::CursorPair::delta ( const pv::util::Timestamp other) const
overridevirtual

Reimplemented from pv::views::trace::TimeItem.

Definition at line 105 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Get the drag point.

Parameters
rectthe rectangle of the widget area.

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

Definition at line 113 of file cursorpair.cpp.

bool pv::views::trace::CursorPair::enabled ( ) const
overridevirtual

Returns true if the item is visible and enabled.

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

Definition at line 73 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

shared_ptr< Cursor > pv::views::trace::CursorPair::first ( ) const

Returns a pointer to the first cursor.

Definition at line 78 of file cursorpair.cpp.

QString pv::views::trace::CursorPair::format_string ( int  max_width = 0,
std::function< double(const QString &)>  query_size = [](const QString& s) -> double { (void)s; return 0; } 
)

Constructs the string to display.

Definition at line 242 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString pv::views::trace::CursorPair::format_string_sub ( int  time_precision,
int  freq_precision,
bool  show_unit = true 
)
private

Definition at line 323 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pair< float, float > pv::views::trace::CursorPair::get_cursor_offsets ( ) const

Definition at line 286 of file cursorpair.cpp.

Here is the caller graph for this function:

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

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

Definition at line 100 of file cursorpair.cpp.

QRectF pv::views::trace::CursorPair::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.
Remarks
The default implementation returns an empty rectangle.

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

Definition at line 167 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::CursorPair::on_hover_point_changed ( const QWidget *  widget,
const QPoint &  hp 
)
slot

Definition at line 309 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::CursorPair::on_setting_changed ( const QString &  key,
const QVariant &  value 
)
overridevirtual

Implements pv::GlobalSettingsInterface.

Definition at line 294 of file cursorpair.cpp.

void pv::views::trace::CursorPair::paint_back ( QPainter &  p,
ViewItemPaintParams pp 
)
overridevirtual

Paints the background 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 227 of file cursorpair.cpp.

Here is the call graph for this function:

void pv::views::trace::CursorPair::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 185 of file cursorpair.cpp.

Here is the call graph for this function:

shared_ptr< Cursor > pv::views::trace::CursorPair::second ( ) const

Returns a pointer to the second cursor.

Definition at line 83 of file cursorpair.cpp.

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

Sets the time of the marker.

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

Definition at line 88 of file cursorpair.cpp.

Here is the call graph for this function:

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

Returns the time this time item is set to.

Returns
0 in case there is no valid time (e.g. for a cursor pair)

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

Definition at line 95 of file cursorpair.cpp.

Here is the caller graph for this function:

Member Data Documentation

const int pv::views::trace::CursorPair::DeltaPadding = 8
staticprivate

Definition at line 48 of file cursorpair.hpp.

QColor pv::views::trace::CursorPair::fill_color_
private

Definition at line 126 of file cursorpair.hpp.

shared_ptr<Cursor> pv::views::trace::CursorPair::first_
private

Definition at line 125 of file cursorpair.hpp.

QRectF pv::views::trace::CursorPair::label_area_
private

Definition at line 129 of file cursorpair.hpp.

bool pv::views::trace::CursorPair::label_incomplete_
private

Definition at line 130 of file cursorpair.hpp.

shared_ptr<Cursor> pv::views::trace::CursorPair::second_
private

Definition at line 125 of file cursorpair.hpp.

bool pv::views::trace::CursorPair::show_frequency_
private

Definition at line 131 of file cursorpair.hpp.

bool pv::views::trace::CursorPair::show_interval_
private

Definition at line 131 of file cursorpair.hpp.

bool pv::views::trace::CursorPair::show_samples_
private

Definition at line 131 of file cursorpair.hpp.

QSizeF pv::views::trace::CursorPair::text_size_
private

Definition at line 128 of file cursorpair.hpp.


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