made formal QtUtils class

This commit is contained in:
itsmattkc
2020-11-17 09:42:36 +11:00
parent 97a15f2c54
commit e2010dde83
19 changed files with 48 additions and 33 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ SeekableWidget::SeekableWidget(QWidget* parent) :
text_height_ = fm.height();
// Set width of playhead marker
playhead_width_ = QFontMetricsWidth(fm, "H");
playhead_width_ = QtUtils::QFontMetricsWidth(fm, "H");
setContextMenuPolicy(Qt::CustomContextMenu);
}
+2 -2
View File
@@ -48,7 +48,7 @@ TimeRuler::TimeRuler(bool text_visible, bool cache_status_visible, QWidget* pare
// Get the "minimum" space allowed between two line markers on the ruler (in screen pixels)
// Mediocre but reliable way of scaling UI objects by font/DPI size
minimum_gap_between_lines_ = QFontMetricsWidth(fm, "H");
minimum_gap_between_lines_ = QtUtils::QFontMetricsWidth(fm, "H");
// Text visibility affects height, so we set that here
UpdateHeight();
@@ -209,7 +209,7 @@ void TimeRuler::paintEvent(QPaintEvent *)
QRect text_rect;
Qt::Alignment text_align;
QString timecode_str = Timecode::timestamp_to_timecode(ScreenToUnit(i), timebase(), Core::instance()->GetTimecodeDisplay());
int timecode_width = QFontMetricsWidth(fm, timecode_str);
int timecode_width = QtUtils::QFontMetricsWidth(fm, timecode_str);
int timecode_left;
if (centered_text_) {