projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replaced lengthy iterator types with the auto keyword
[pulseview.git]
/
pv
/
view
/
header.cpp
diff --git
a/pv/view/header.cpp
b/pv/view/header.cpp
index a7902521216a90655ba708669ab5b36b2886f52b..a00efb14664534e689464b398040b39d302011ab 100644
(file)
--- a/
pv/view/header.cpp
+++ b/
pv/view/header.cpp
@@
-72,7
+72,10
@@
QSize Header::sizeHint() const
const vector< shared_ptr<Trace> > traces(_view.get_traces());
BOOST_FOREACH(shared_ptr<Trace> t, traces) {
assert(t);
const vector< shared_ptr<Trace> > traces(_view.get_traces());
BOOST_FOREACH(shared_ptr<Trace> t, traces) {
assert(t);
- max_width = max(max_width, (int)t->get_label_rect(0).width());
+
+ if (t->enabled()) {
+ max_width = max(max_width, (int)t->get_label_rect(0).width());
+ }
}
return QSize(max_width + Padding, 0);
}
return QSize(max_width + Padding, 0);
@@
-220,9
+223,7
@@
void Header::mouseMoveEvent(QMouseEvent *event)
const int delta = event->pos().y() - _mouse_down_point.y();
const int delta = event->pos().y() - _mouse_down_point.y();
- for (std::list<std::pair<boost::weak_ptr<Trace>,
- int> >::iterator i = _drag_traces.begin();
- i != _drag_traces.end(); i++) {
+ for (auto i = _drag_traces.begin(); i != _drag_traces.end(); i++) {
const boost::shared_ptr<Trace> trace((*i).first);
if (trace) {
const int y = (*i).second + delta;
const boost::shared_ptr<Trace> trace((*i).first);
if (trace) {
const int y = (*i).second + delta;
@@
-281,9
+282,9
@@
void Header::on_signals_changed()
BOOST_FOREACH(shared_ptr<Trace> t, traces) {
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
BOOST_FOREACH(shared_ptr<Trace> t, traces) {
assert(t);
connect(t.get(), SIGNAL(visibility_changed()),
- this, SLOT(
update
()));
+ this, SLOT(
on_trace_changed
()));
connect(t.get(), SIGNAL(text_changed()),
connect(t.get(), SIGNAL(text_changed()),
- this, SLOT(on_trace_
text_
changed()));
+ this, SLOT(on_trace_changed()));
connect(t.get(), SIGNAL(colour_changed()),
this, SLOT(update()));
}
connect(t.get(), SIGNAL(colour_changed()),
this, SLOT(update()));
}
@@
-294,7
+295,7
@@
void Header::on_signals_moved()
update();
}
update();
}
-void Header::on_trace_
text_
changed()
+void Header::on_trace_changed()
{
update();
geometry_updated();
{
update();
geometry_updated();