File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,10 +50,11 @@ ScrubBar::ScrubBar(QWidget *parent)
5050void ScrubBar::setScale (int maximum)
5151{
5252 if (!m_timecodeWidth) {
53- const int fontSize = font ().pointSize ()
54- - (font ().pointSize () > 10 ? 2 : (font ().pointSize () > 8 ? 1 : 0 ));
55- setFont (QFont (font ().family (), fontSize * devicePixelRatioF ()));
56- m_timecodeWidth = fontMetrics ().horizontalAdvance (" 00:00:00:00" ) / devicePixelRatioF ();
53+ auto font = QWidget::font ();
54+ const int fontSize = font.pointSize ()
55+ - (font.pointSize () > 10 ? 2 : (font.pointSize () > 8 ? 1 : 0 ));
56+ font.setPointSizeF (devicePixelRatioF () * fontSize);
57+ m_timecodeWidth = QFontMetrics (font).horizontalAdvance (" 00:00:00:00" ) / devicePixelRatioF ();
5758 }
5859 m_max = maximum;
5960 // / m_scale is the pixels per frame ratio
@@ -283,8 +284,10 @@ void ScrubBar::updatePixmap()
283284 m_pixmap = QPixmap (l_width, l_height);
284285 m_pixmap.fill (palette ().window ().color ());
285286 QPainter p (&m_pixmap);
286- p.setFont (font ());
287- const int markerHeight = fontMetrics ().ascent () + 2 * ratio;
287+ QFont font (QWidget::font ());
288+ font.setPointSizeF (font.pointSizeF () * ratio);
289+ p.setFont (font);
290+ const int markerHeight = QFontMetrics (font).ascent () + 2 ;
288291 QPen pen;
289292
290293 if (!isEnabled ()) {
You can’t perform that action at this time.
0 commit comments