]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/ruler.cpp
Replace obsolete/deprecated Qt methods
[pulseview.git] / pv / views / trace / ruler.cpp
index 555794fc42c6e881c5691fc1d64c43a0355e7cd3..83ffed281b5f6768085d1a03ee77f2840a443487 100644 (file)
@@ -283,7 +283,7 @@ void Ruler::paintEvent(QPaintEvent*)
                const int rightedge = width();
                const int x_tick = tick.first;
                if ((x_tick > leftedge) && (x_tick < rightedge)) {
                const int rightedge = width();
                const int x_tick = tick.first;
                if ((x_tick > leftedge) && (x_tick < rightedge)) {
-                       const int x_left_bound = QFontMetrics(font()).width(tick.second) / 2;
+                       const int x_left_bound = util::text_width(QFontMetrics(font()), tick.second) / 2;
                        const int x_right_bound = rightedge - x_left_bound;
                        const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
                        p.drawText(x_legend, ValueMargin, 0, text_height,
                        const int x_right_bound = rightedge - x_left_bound;
                        const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
                        p.drawText(x_legend, ValueMargin, 0, text_height,