18#include "TimelineHeader.hpp"
23#include "TimeUnitLabel.hpp"
24#include "src/utils.hpp"
27 this->setLayout(
new QHBoxLayout(
this));
31 connect(this->data, SIGNAL(selectionChanged(types::TraceTime,types::TraceTime)),
this, SLOT(
updateView()));
36 auto layout = this->layout();
38 auto runtime =
static_cast<double>(selection->getRuntime().count());
39 auto begin =
static_cast<double>(selection->getStartTime().count());
44 for (
int i = 0; i <= marks; i++) {
45 double num = begin +
static_cast<double>(i)/marks * runtime;
47 layout->addWidget(label);
49 dynamic_cast<QHBoxLayout *
>(layout)->addStretch();
TimeUnitLabel constructs a QLabel from a double value that represents a time point.
Model class providing access to data and pub/sub architecture of change events.
Trace * getSelection() const
Returns the current selection.