projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
View: Determine time unit and use it in other classes
[pulseview.git]
/
pv
/
view
/
tracegroup.cpp
diff --git
a/pv/view/tracegroup.cpp
b/pv/view/tracegroup.cpp
index 765f0973229739e4cf7114333c2d58da70f3d1aa..74221d440a15331a0ac657cadab0b3cf88b8399d 100644
(file)
--- a/
pv/view/tracegroup.cpp
+++ b/
pv/view/tracegroup.cpp
@@
-26,7
+26,7
@@
#include <QMenu>
#include <QPainter>
#include <QMenu>
#include <QPainter>
-#include "tracegroup.h"
+#include "tracegroup.h
pp
"
using std::pair;
using std::shared_ptr;
using std::pair;
using std::shared_ptr;
@@
-42,7
+42,7
@@
const QColor TraceGroup::LineColour(QColor(0x55, 0x57, 0x53));
TraceGroup::~TraceGroup()
{
TraceGroup::~TraceGroup()
{
-
_owner
= nullptr;
+
owner_
= nullptr;
clear_child_items();
}
clear_child_items();
}
@@
-52,28
+52,28
@@
bool TraceGroup::enabled() const
[](const shared_ptr<RowItem> &r) { return r->enabled(); });
}
[](const shared_ptr<RowItem> &r) { return r->enabled(); });
}
-pv::S
igS
ession& TraceGroup::session()
+pv::Session& TraceGroup::session()
{
{
- assert(
_owner
);
- return
_owner
->session();
+ assert(
owner_
);
+ return
owner_
->session();
}
}
-const pv::S
igS
ession& TraceGroup::session() const
+const pv::Session& TraceGroup::session() const
{
{
- assert(
_owner
);
- return
_owner
->session();
+ assert(
owner_
);
+ return
owner_
->session();
}
pv::view::View* TraceGroup::view()
{
}
pv::view::View* TraceGroup::view()
{
- assert(
_owner
);
- return
_owner
->view();
+ assert(
owner_
);
+ return
owner_
->view();
}
const pv::view::View* TraceGroup::view() const
{
}
const pv::view::View* TraceGroup::view() const
{
- assert(
_owner
);
- return
_owner
->view();
+ assert(
owner_
);
+ return
owner_
->view();
}
pair<int, int> TraceGroup::v_extents() const
}
pair<int, int> TraceGroup::v_extents() const
@@
-81,9
+81,9
@@
pair<int, int> TraceGroup::v_extents() const
return RowItemOwner::v_extents();
}
return RowItemOwner::v_extents();
}
-void TraceGroup::paint_label(QPainter &p,
int righ
t, bool hover)
+void TraceGroup::paint_label(QPainter &p,
const QRect &rec
t, bool hover)
{
{
- const QRectF r = label_rect(r
igh
t).adjusted(
+ const QRectF r = label_rect(r
ec
t).adjusted(
LineThickness / 2, LineThickness / 2,
-LineThickness / 2, -LineThickness / 2);
LineThickness / 2, LineThickness / 2,
-LineThickness / 2, -LineThickness / 2);
@@
-112,15
+112,15
@@
void TraceGroup::paint_label(QPainter &p, int right, bool hover)
p.drawPolyline(points, countof(points));
}
p.drawPolyline(points, countof(points));
}
-QRectF TraceGroup::label_rect(
int righ
t) const
+QRectF TraceGroup::label_rect(
const QRectF &rec
t) const
{
{
- QRectF rect;
+ QRectF
child_
rect;
for (const shared_ptr<RowItem> r : child_items())
if (r && r->enabled())
for (const shared_ptr<RowItem> r : child_items())
if (r && r->enabled())
-
rect = rect.united(r->label_rect(righ
t));
+
child_rect = child_rect.united(r->label_rect(rec
t));
- return QRectF(
rect.x() - Width - Padding,
rect.y(),
- Width, rect.height());
+ return QRectF(
child_rect.x() - Width - Padding, child_
rect.y(),
+ Width,
child_
rect.height());
}
bool TraceGroup::pt_in_label_rect(int left, int right, const QPoint &point)
}
bool TraceGroup::pt_in_label_rect(int left, int right, const QPoint &point)
@@
-147,12
+147,12
@@
QMenu* TraceGroup::create_context_menu(QWidget *parent)
pv::widgets::Popup* TraceGroup::create_popup(QWidget *parent)
{
(void)parent;
pv::widgets::Popup* TraceGroup::create_popup(QWidget *parent)
{
(void)parent;
- return
NULL
;
+ return
nullptr
;
}
int TraceGroup::owner_visual_v_offset() const
{
}
int TraceGroup::owner_visual_v_offset() const
{
- return
_owner ? visual_v_offset() + _owner
->owner_visual_v_offset() : 0;
+ return
owner_ ? visual_v_offset() + owner_
->owner_visual_v_offset() : 0;
}
void TraceGroup::restack_items()
}
void TraceGroup::restack_items()
@@
-192,7
+192,7
@@
void TraceGroup::restack_items()
unsigned int TraceGroup::depth() const
{
unsigned int TraceGroup::depth() const
{
- return
_owner ? _owner
->depth() + 1 : 0;
+ return
owner_ ? owner_
->depth() + 1 : 0;
}
void TraceGroup::ungroup()
}
void TraceGroup::ungroup()
@@
-202,9
+202,9
@@
void TraceGroup::ungroup()
clear_child_items();
for (shared_ptr<RowItem> r : items)
clear_child_items();
for (shared_ptr<RowItem> r : items)
-
_owner
->add_child_item(r);
+
owner_
->add_child_item(r);
-
_owner
->remove_child_item(shared_from_this());
+
owner_
->remove_child_item(shared_from_this());
}
void TraceGroup::on_ungroup()
}
void TraceGroup::on_ungroup()
@@
-212,16
+212,16
@@
void TraceGroup::on_ungroup()
ungroup();
}
ungroup();
}
-void TraceGroup::appearance_changed(bool label, bool content)
+void TraceGroup::
row_item_
appearance_changed(bool label, bool content)
{
{
- if (
_owner
)
-
_owner->
appearance_changed(label, content);
+ if (
owner_
)
+
owner_->row_item_
appearance_changed(label, content);
}
void TraceGroup::extents_changed(bool horz, bool vert)
{
}
void TraceGroup::extents_changed(bool horz, bool vert)
{
- if (
_owner
)
-
_owner
->extents_changed(horz, vert);
+ if (
owner_
)
+
owner_
->extents_changed(horz, vert);
}
} // namespace view
}
} // namespace view