projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
View: Store CursorPair in a shared_ptr
[pulseview.git]
/
pv
/
view
/
view.cpp
diff --git
a/pv/view/view.cpp
b/pv/view/view.cpp
index 28408eee39db4723497d906ae8a21b02e901427d..4575d05e2b7dd0fc58009a4bc927892dbe52a9a3 100644
(file)
--- a/
pv/view/view.cpp
+++ b/
pv/view/view.cpp
@@
-104,7
+104,7
@@
View::View(Session &session, QWidget *parent) :
tick_period_(0.0),
tick_prefix_(0),
show_cursors_(false),
tick_period_(0.0),
tick_prefix_(0),
show_cursors_(false),
- cursors_(
*this
),
+ cursors_(
new CursorPair(*this)
),
hover_point_(-1, -1)
{
connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
hover_point_(-1, -1)
{
connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
@@
-121,9
+121,9
@@
View::View(Session &session, QWidget *parent) :
connect(&session_, SIGNAL(frame_ended()),
this, SLOT(data_updated()));
connect(&session_, SIGNAL(frame_ended()),
this, SLOT(data_updated()));
- connect(cursors_
.
first().get(), SIGNAL(time_changed()),
+ connect(cursors_
->
first().get(), SIGNAL(time_changed()),
this, SLOT(marker_time_changed()));
this, SLOT(marker_time_changed()));
- connect(cursors_
.
second().get(), SIGNAL(time_changed()),
+ connect(cursors_
->
second().get(), SIGNAL(time_changed()),
this, SLOT(marker_time_changed()));
connect(header_, SIGNAL(signals_moved()),
this, SLOT(marker_time_changed()));
connect(header_, SIGNAL(signals_moved()),
@@
-198,8
+198,8
@@
const Viewport* View::viewport() const
vector< shared_ptr<TimeItem> > View::time_items() const
{
vector< shared_ptr<TimeItem> > items;
vector< shared_ptr<TimeItem> > View::time_items() const
{
vector< shared_ptr<TimeItem> > items;
- items.push_back(cursors_
.
first());
- items.push_back(cursors_
.
second());
+ items.push_back(cursors_
->
first());
+ items.push_back(cursors_
->
second());
return items;
}
return items;
}
@@
-357,18
+357,13
@@
void View::show_cursors(bool show)
void View::centre_cursors()
{
const double time_width = scale_ * viewport_->width();
void View::centre_cursors()
{
const double time_width = scale_ * viewport_->width();
- cursors_
.
first()->set_time(offset_ + time_width * 0.4);
- cursors_
.
second()->set_time(offset_ + time_width * 0.6);
+ cursors_
->
first()->set_time(offset_ + time_width * 0.4);
+ cursors_
->
second()->set_time(offset_ + time_width * 0.6);
cursorheader_->update();
viewport_->update();
}
cursorheader_->update();
viewport_->update();
}
-CursorPair& View::cursors()
-{
- return cursors_;
-}
-
-const CursorPair& View::cursors() const
+std::shared_ptr<CursorPair> View::cursors() const
{
return cursors_;
}
{
return cursors_;
}