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

#include <flag.hpp>

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

Public Member Functions

 Flag (View &view, const pv::util::Timestamp &time, const QString &text)
 
 Flag (const Flag &flag)
 
virtual bool enabled () const override
 
virtual QString get_display_text () const override
 
virtual QString get_text () const override
 
virtual void set_text (const QString &text) override
 
virtual pv::widgets::Popupcreate_popup (QWidget *parent) override
 
virtual QMenu * create_header_context_menu (QWidget *parent) override
 
virtual void delete_pressed () override
 
QRectF label_rect (const QRectF &rect) const override
 
- Public Member Functions inherited from pv::views::trace::TimeMarker
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
 
void paint_label (QPainter &p, const QRect &rect, bool hover) override
 
void paint_fore (QPainter &p, ViewItemPaintParams &pp) 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 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_view_context_menu (QWidget *parent, QPoint &click_pos)
 
virtual void hover_point_changed (const QPoint &hp)
 
virtual void mouse_left_press_event (const QMouseEvent *event)
 

Static Public Attributes

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

Private Slots

void on_delete ()
 
void on_text_changed (const QString &text)
 

Private Attributes

QString text_
 

Additional Inherited Members

- Static Public Member Functions inherited from pv::views::trace::ViewItem
static QColor select_text_color (QColor background)
 
- Protected Member Functions inherited from pv::views::trace::TimeMarker
 TimeMarker (View &view, const QColor &color, const pv::util::Timestamp &time)
 
- 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::TimeMarker
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_
 

Detailed Description

The Flag class represents items on the Ruler that mark important events on the timeline to the user. They are editable and thus non-static.

Definition at line 39 of file flag.hpp.

Constructor & Destructor Documentation

pv::views::trace::Flag::Flag ( View view,
const pv::util::Timestamp time,
const QString &  text 
)

Constructor.

Parameters
viewA reference to the view that owns this cursor pair.
timeThe time to set the flag to.
textThe text of the marker.

Definition at line 43 of file flag.cpp.

pv::views::trace::Flag::Flag ( const Flag flag)

Copy constructor.

Definition at line 49 of file flag.cpp.

Member Function Documentation

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

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

Definition at line 149 of file flag.cpp.

Here is the call graph for this function:

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

Reimplemented from pv::views::trace::TimeMarker.

Definition at line 128 of file flag.cpp.

Here is the call graph for this function:

void pv::views::trace::Flag::delete_pressed ( )
overridevirtual

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

Definition at line 167 of file flag.cpp.

Here is the call graph for this function:

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

Returns true if the item is visible and enabled.

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

Definition at line 55 of file flag.cpp.

QString pv::views::trace::Flag::get_display_text ( ) const
overridevirtual

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

Returns the text used to display this flag item. This is not necessarily the name that the user has given it.

Reimplemented from pv::views::trace::TimeMarker.

Definition at line 64 of file flag.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString pv::views::trace::Flag::get_text ( ) const
overridevirtual

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

Returns the text of this flag item, i.e. the user-editable name.

Implements pv::views::trace::TimeMarker.

Definition at line 83 of file flag.cpp.

QRectF pv::views::trace::Flag::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 94 of file flag.cpp.

Here is the call graph for this function:

void pv::views::trace::Flag::on_delete ( )
privateslot

Definition at line 172 of file flag.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::Flag::on_text_changed ( const QString &  text)
privateslot

Definition at line 177 of file flag.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::views::trace::Flag::set_text ( const QString &  text)
overridevirtual

Sets the text to show in the marker.

Reimplemented from pv::views::trace::TimeMarker.

Definition at line 88 of file flag.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

const QColor pv::views::trace::Flag::FillColor
static

Definition at line 44 of file flag.hpp.

QString pv::views::trace::Flag::text_
private

Definition at line 95 of file flag.hpp.


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