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
@@ -63,7 +63,7 @@ ImportTool::ImportTool(TimelineWidget *parent) :
TimelineTool(parent)
{
// Calculate width used for importing to give ghosts a slight lead-in so the ghosts aren't right on the cursor
import_pre_buffer_ = QFontMetricsWidth(parent->fontMetrics(), "HHHHHHHH");
import_pre_buffer_ = QtUtils::QFontMetricsWidth(parent->fontMetrics(), "HHHHHHHH");
}
void ImportTool::DragEnter(TimelineViewMouseEvent *event)
+1 -1
View File
@@ -717,7 +717,7 @@ void PointerTool::FinishDrag(TimelineViewMouseEvent *event)
Timeline::MovementMode PointerTool::IsCursorInTrimHandle(TimelineViewBlockItem *block, qreal cursor_x)
{
double kTrimHandle = QFontMetricsWidth(parent()->fontMetrics(), "H");
double kTrimHandle = QtUtils::QFontMetricsWidth(parent()->fontMetrics(), "H");
// Block is too narrow, no trimming allowed
if (block->rect().width() <= kTrimHandle * 2) {
@@ -120,7 +120,7 @@ void TimelineViewBlockItem::paint(QPainter *painter, const QStyleOptionGraphicsI
// Linked clips are underlined
if (block_->HasLinks()) {
QFontMetrics fm = painter->fontMetrics();
int text_width = qMin(qRound(rect().width()), QFontMetricsWidth(fm, block_->GetLabel()));
int text_width = qMin(qRound(rect().width()), QtUtils::QFontMetricsWidth(fm, block_->GetLabel()));
QPointF underline_start = rect().topLeft() + QPointF(0, text_top + fm.height());
QPointF underline_end = underline_start + QPointF(text_width, 0);