PulseView
unreleased development snapshot
A Qt-based sigrok GUI
|
#include <viewitem.hpp>
Public Member Functions | |
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 | drag_by (const QPoint &delta)=0 |
virtual QPoint | drag_point (const QRect &rect) const =0 |
virtual QRectF | label_rect (const QRectF &rect) const |
virtual QRectF | hit_box_rect (const ViewItemPaintParams &pp) const |
virtual void | paint_label (QPainter &p, const QRect &rect, bool hover) |
virtual void | paint_back (QPainter &p, ViewItemPaintParams &pp) |
virtual void | paint_mid (QPainter &p, ViewItemPaintParams &pp) |
virtual void | paint_fore (QPainter &p, ViewItemPaintParams &pp) |
virtual QMenu * | create_header_context_menu (QWidget *parent) |
virtual QMenu * | create_view_context_menu (QWidget *parent, QPoint &click_pos) |
virtual pv::widgets::Popup * | create_popup (QWidget *parent) |
virtual void | delete_pressed () |
virtual void | hover_point_changed (const QPoint &hp) |
virtual void | mouse_left_press_event (const QMouseEvent *event) |
Static Public Member Functions | |
static QColor | select_text_color (QColor background) |
Static Public Attributes | |
static const QSizeF | LabelPadding |
static const int | HighlightRadius = 3 |
Static Protected Member Functions | |
static QPen | highlight_pen () |
Protected Attributes | |
QWidget * | context_parent_ |
QPoint | drag_point_ |
Private Attributes | |
bool | selected_ |
Definition at line 46 of file viewitem.hpp.
pv::views::trace::ViewItem::ViewItem | ( | ) |
Definition at line 35 of file viewitem.cpp.
|
virtual |
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::Trace, pv::views::trace::TraceGroup, pv::views::trace::Signal, pv::views::trace::CursorPair, pv::views::trace::Flag, and pv::views::trace::Cursor.
Definition at line 91 of file viewitem.cpp.
|
virtual |
Reimplemented in pv::views::trace::Trace, pv::views::trace::TimeMarker, pv::views::trace::TraceGroup, pv::views::trace::CursorPair, and pv::views::trace::Flag.
Definition at line 104 of file viewitem.cpp.
|
virtual |
Reimplemented in pv::views::trace::DecodeTrace, and pv::views::trace::Trace.
Definition at line 97 of file viewitem.cpp.
|
virtual |
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::Signal, and pv::views::trace::Flag.
Definition at line 110 of file viewitem.cpp.
void pv::views::trace::ViewItem::drag | ( | ) |
Sets this item into the dragged state.
Definition at line 69 of file viewitem.cpp.
|
pure virtual |
Drags the item to a delta relative to the drag point.
delta | the offset from the drag point. |
Implemented in pv::views::trace::TraceTreeItem, and pv::views::trace::TimeItem.
|
pure virtual |
Get the drag point.
rect | the rectangle of the widget area. |
Implemented in pv::views::trace::TraceTreeItem, pv::views::trace::CursorPair, pv::views::trace::TimeMarker, and pv::views::trace::TriggerMarker.
|
virtual |
Sets this item into the un-dragged state.
Definition at line 74 of file viewitem.cpp.
bool pv::views::trace::ViewItem::dragging | ( | ) | const |
Returns true if the item is being dragged.
Definition at line 64 of file viewitem.cpp.
|
pure virtual |
Returns true if the item is visible and enabled.
Implemented in pv::views::trace::DecodeTrace, pv::views::trace::Signal, pv::views::trace::Flag, pv::views::trace::CursorPair, pv::views::trace::TriggerMarker, pv::views::trace::Cursor, and pv::views::trace::TraceGroup.
|
staticprotected |
|
virtual |
Computes the outline rectangle of the viewport hit-box.
rect | the rectangle of the viewport area. |
Reimplemented in pv::views::trace::Trace, and pv::views::trace::TimeMarker.
Definition at line 85 of file viewitem.cpp.
|
virtual |
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::Trace, and pv::views::trace::AnalogSignal.
Definition at line 151 of file viewitem.cpp.
|
virtual |
Returns true if the item may be dragged/moved.
Reimplemented in pv::views::trace::Trace, and pv::views::trace::TriggerMarker.
Definition at line 58 of file viewitem.cpp.
|
virtual |
Returns true if the item may be selected.
Reimplemented in pv::views::trace::Trace.
Definition at line 42 of file viewitem.cpp.
|
virtual |
Computes the outline rectangle of a label.
rect | the rectangle of the header area. |
Reimplemented in pv::views::trace::Trace, pv::views::trace::TraceGroup, pv::views::trace::CursorPair, pv::views::trace::TimeMarker, pv::views::trace::Flag, and pv::views::trace::Cursor.
Definition at line 79 of file viewitem.cpp.
|
virtual |
Handles left mouse button press events.
event | the mouse event that triggered this handler. |
Reimplemented in pv::views::trace::DecodeTrace.
Definition at line 156 of file viewitem.cpp.
|
virtual |
Paints the background layer of the item with a QPainter
p | the QPainter to paint into. |
pp | the painting parameters object to paint with. |
Reimplemented in pv::views::trace::Trace, pv::views::trace::DecodeTrace, pv::views::trace::CursorPair, pv::views::trace::Signal, and pv::views::trace::AnalogSignal.
Definition at line 128 of file viewitem.cpp.
|
virtual |
Paints the foreground layer of the item with a QPainter
p | the QPainter to paint into. |
pp | the painting parameters object to paint with. |
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::TimeMarker, pv::views::trace::AnalogSignal, pv::views::trace::LogicSignal, and pv::views::trace::TriggerMarker.
Definition at line 140 of file viewitem.cpp.
|
virtual |
Paints the signal label.
p | the QPainter to paint into. |
rect | the rectangle of the header area. |
hover | true if the label is being hovered over by the mouse. |
Reimplemented in pv::views::trace::Trace, pv::views::trace::TimeMarker, pv::views::trace::CursorPair, and pv::views::trace::TraceGroup.
Definition at line 121 of file viewitem.cpp.
|
virtual |
Paints the mid-layer of the item with a QPainter
p | the QPainter to paint into. |
pp | the painting parameters object to paint with. |
Reimplemented in pv::views::trace::DecodeTrace, pv::views::trace::AnalogSignal, and pv::views::trace::LogicSignal.
Definition at line 134 of file viewitem.cpp.
|
virtual |
Selects or deselects the signal.
Reimplemented in pv::views::trace::TraceTreeItem.
Definition at line 53 of file viewitem.cpp.
|
static |
Gets the text color.
Definition at line 146 of file viewitem.cpp.
bool pv::views::trace::ViewItem::selected | ( | ) | const |
Returns true if the item has been selected by the user.
Definition at line 48 of file viewitem.cpp.
|
protected |
Definition at line 183 of file viewitem.hpp.
|
protected |
Definition at line 184 of file viewitem.hpp.
|
static |
Definition at line 52 of file viewitem.hpp.
|
static |
Definition at line 51 of file viewitem.hpp.
|
private |
Definition at line 187 of file viewitem.hpp.