#include <extdef.h>
#include <assert.h>
-#include <math.h>
+#include <cmath>
#include <QApplication>
#include <QFormLayout>
Trace::Trace(QString name) :
name_(name),
- popup_(NULL),
- popup_form_(NULL)
+ popup_(nullptr),
+ popup_form_(nullptr)
{
}
label_size.height());
}
+QRectF Trace::hit_box_rect(const QRectF &rect) const
+{
+ const float h = QFontMetrics(QApplication::font()).height();
+ return QRectF(rect.left(), get_visual_y() - h / 2.0f,
+ rect.width(), h);
+}
+
void Trace::paint_axis(QPainter &p, const ViewItemPaintParams &pp, int y)
{
p.setPen(AxisPen);
void Trace::on_popup_closed()
{
- popup_ = NULL;
- popup_form_ = NULL;
+ popup_ = nullptr;
+ popup_form_ = nullptr;
}
void Trace::on_text_changed(const QString &text)