various: extended marker and timeline functionality
This commit is contained in:
@@ -50,6 +50,7 @@ void ResizableTimelineScrollBar::ConnectTimelinePoints(TimelinePoints *points)
|
||||
disconnect(points_->workarea(), &TimelineWorkArea::EnabledChanged, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
disconnect(points_->markers(), &TimelineMarkerList::MarkerAdded, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
disconnect(points_->markers(), &TimelineMarkerList::MarkerRemoved, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
disconnect(points_->markers(), &TimelineMarkerList::MarkerModified, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
}
|
||||
|
||||
points_ = points;
|
||||
@@ -59,6 +60,7 @@ void ResizableTimelineScrollBar::ConnectTimelinePoints(TimelinePoints *points)
|
||||
connect(points_->workarea(), &TimelineWorkArea::EnabledChanged, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
connect(points_->markers(), &TimelineMarkerList::MarkerAdded, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
connect(points_->markers(), &TimelineMarkerList::MarkerRemoved, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
connect(points_->markers(), &TimelineMarkerList::MarkerModified, this, static_cast<void (ResizableTimelineScrollBar::*)()>(&ResizableTimelineScrollBar::update));
|
||||
}
|
||||
|
||||
update();
|
||||
@@ -77,7 +79,7 @@ void ResizableTimelineScrollBar::paintEvent(QPaintEvent *event)
|
||||
|
||||
if (points_
|
||||
&& !timebase().isNull()
|
||||
&& (points_->workarea()->enabled() || !points_->markers()->list().empty())) {
|
||||
&& (points_->workarea()->enabled() || !points_->markers()->empty())) {
|
||||
QStyleOptionSlider opt;
|
||||
initStyleOption(&opt);
|
||||
|
||||
@@ -110,11 +112,13 @@ void ResizableTimelineScrollBar::paintEvent(QPaintEvent *event)
|
||||
workarea_color);
|
||||
}
|
||||
|
||||
if (!points_->markers()->list().empty()) {
|
||||
foreach (TimelineMarker* marker, points_->markers()->list()) {
|
||||
if (!points_->markers()->empty()) {
|
||||
for (auto it=points_->markers()->cbegin(); it!=points_->markers()->cend(); it++) {
|
||||
TimelineMarker* marker = *it;
|
||||
|
||||
QColor marker_color = ColorCoding::GetColor(marker->color()).toQColor();
|
||||
int64_t in = qRound64(ratio * TimeToScene(marker->time().in()));
|
||||
int64_t out = qRound64(ratio * TimeToScene(marker->time().out()));
|
||||
int64_t in = qRound64(ratio * TimeToScene(marker->time_range().in()));
|
||||
int64_t out = qRound64(ratio * TimeToScene(marker->time_range().out()));
|
||||
int64_t length = qMax(int64_t(1), out-in);
|
||||
|
||||
p.fillRect(gr.x() + in,
|
||||
|
||||
Reference in New Issue
Block a user