PulseView  0.3.0
A Qt-based sigrok GUI
pv::view::CursorPair Class Reference

#include <cursorpair.hpp>

Inheritance diagram for pv::view::CursorPair:
Collaboration diagram for pv::view::CursorPair:

Public Member Functions

 CursorPair (View &view)
 
bool enabled () const
 
std::shared_ptr< Cursorfirst () const
 
std::shared_ptr< Cursorsecond () const
 
void set_time (const pv::util::Timestamp &time) override
 
float get_x () const
 
QPoint point (const QRect &rect) const
 
pv::widgets::Popupcreate_popup (QWidget *parent)
 
QRectF label_rect (const QRectF &rect) const
 
void paint_label (QPainter &p, const QRect &rect, bool hover)
 
void paint_back (QPainter &p, const ViewItemPaintParams &pp)
 
QString format_string ()
 
void compute_text_size (QPainter &p)
 
std::pair< float, float > get_cursor_offsets () const
 
- Public Member Functions inherited from pv::view::TimeItem
void drag_by (const QPoint &delta)
 
- Public Member Functions inherited from pv::view::ViewItem
 ViewItem ()
 
bool selected () const
 
virtual void select (bool select=true)
 
virtual bool is_draggable () 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, const ViewItemPaintParams &pp)
 
virtual void paint_fore (QPainter &p, const ViewItemPaintParams &pp)
 
virtual QMenu * create_context_menu (QWidget *parent)
 
virtual void delete_pressed ()
 

Private Attributes

std::shared_ptr< Cursorfirst_
 
std::shared_ptr< Cursorsecond_
 
QSizeF text_size_
 

Static Private Attributes

static const int DeltaPadding = 8
 
static const QColor ViewportFillColour
 

Additional Inherited Members

- Static Public Member Functions inherited from pv::view::ViewItem
static QColor select_text_colour (QColor background)
 
- Static Public Attributes inherited from pv::view::ViewItem
static const QSizeF LabelPadding
 
static const int HighlightRadius = 3
 
- Protected Member Functions inherited from pv::view::TimeItem
 TimeItem (View &view)
 
- Static Protected Member Functions inherited from pv::view::ViewItem
static QPen highlight_pen ()
 
- Protected Attributes inherited from pv::view::TimeItem
Viewview_
 
- Protected Attributes inherited from pv::view::ViewItem
QWidget * context_parent_
 
QPoint drag_point_
 

Detailed Description

Definition at line 35 of file cursorpair.hpp.

Constructor & Destructor Documentation

pv::view::CursorPair::CursorPair ( View view)

Constructor.

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

Definition at line 42 of file cursorpair.cpp.

Member Function Documentation

void pv::view::CursorPair::compute_text_size ( QPainter &  p)

Definition at line 177 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

pv::widgets::Popup * pv::view::CursorPair::create_popup ( QWidget *  parent)
virtual

Reimplemented from pv::view::ViewItem.

Definition at line 81 of file cursorpair.cpp.

bool pv::view::CursorPair::enabled ( ) const
virtual

Returns true if the item is visible and enabled.

Implements pv::view::ViewItem.

Definition at line 49 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

shared_ptr< Cursor > pv::view::CursorPair::first ( ) const

Returns a pointer to the first cursor.

Definition at line 54 of file cursorpair.cpp.

QString pv::view::CursorPair::format_string ( )

Constructs the string to display.

Definition at line 164 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 185 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

float pv::view::CursorPair::get_x ( ) const
virtual

Implements pv::view::TimeItem.

Definition at line 71 of file cursorpair.cpp.

QRectF pv::view::CursorPair::label_rect ( const QRectF &  rect) const
virtual

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::view::ViewItem.

Definition at line 87 of file cursorpair.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::view::CursorPair::paint_back ( QPainter &  p,
const ViewItemPaintParams pp 
)
virtual

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::view::ViewItem.

Definition at line 147 of file cursorpair.cpp.

Here is the call graph for this function:

void pv::view::CursorPair::paint_label ( QPainter &  p,
const QRect &  rect,
bool  hover 
)
virtual

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::view::ViewItem.

Definition at line 105 of file cursorpair.cpp.

Here is the call graph for this function:

QPoint pv::view::CursorPair::point ( const QRect &  rect) const
virtual

Get the drag point.

Parameters
rectthe rectangle of the widget area.

Implements pv::view::ViewItem.

Definition at line 76 of file cursorpair.cpp.

shared_ptr< Cursor > pv::view::CursorPair::second ( ) const

Returns a pointer to the second cursor.

Definition at line 59 of file cursorpair.cpp.

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

Sets the time of the marker.

Implements pv::view::TimeItem.

Definition at line 64 of file cursorpair.cpp.

Member Data Documentation

const int pv::view::CursorPair::DeltaPadding = 8
staticprivate

Definition at line 38 of file cursorpair.hpp.

std::shared_ptr<Cursor> pv::view::CursorPair::first_
private

Definition at line 103 of file cursorpair.hpp.

std::shared_ptr<Cursor> pv::view::CursorPair::second_
private

Definition at line 103 of file cursorpair.hpp.

QSizeF pv::view::CursorPair::text_size_
private

Definition at line 105 of file cursorpair.hpp.

const QColor pv::view::CursorPair::ViewportFillColour
staticprivate

Definition at line 39 of file cursorpair.hpp.


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