27 #include <QApplication>
39 using std::shared_ptr;
40 using std::numeric_limits;
73 QFontMetrics m(QApplication::font());
74 QSize text_size = m.boundingRect(
get_text()).size();
76 const QSizeF label_size(
79 const float top = rect.height() - label_size.height() -
81 const float height = label_size.height();
85 if (
time_ > other_time ||
86 (abs(
time_ - other_time).is_zero() &&
this > other.get()))
87 return QRectF(x, top, label_size.width(), height);
89 return QRectF(x - label_size.width(), top, label_size.width(), height);
96 return (cursors->first().get() ==
this) ?
97 cursors->second() : cursors->first();
static const QSizeF LabelPadding
std::shared_ptr< CursorPair > cursors() const
pv::util::SIPrefix tick_prefix() const
Cursor(View &view, double time)
static const int ArrowSize
static const QColor FillColour
unsigned int tick_precision() const
static QString format_time_with_distance(const pv::util::Timestamp &distance, const pv::util::Timestamp &t, pv::util::SIPrefix prefix=pv::util::SIPrefix::unspecified, pv::util::TimeUnit unit=pv::util::TimeUnit::Time, unsigned precision=0, bool sign=true)
pv::util::Timestamp time_
util::TimeUnit time_unit() const
bool cursors_shown() const
std::shared_ptr< Cursor > get_other_cursor() const
const pv::util::Timestamp & offset() const
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 24 >, boost::multiprecision::et_off > Timestamp
Timestamp type providing yoctosecond resolution.
QRectF label_rect(const QRectF &rect) const