Skip to content

Commit

Permalink
fix: size hint not correct
Browse files Browse the repository at this point in the history
  • Loading branch information
BLumia committed Oct 18, 2018
1 parent 3b91cc0 commit 440255b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datetimewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ QSize DatetimeWidget::sizeHint() const
QFontMetrics fm(qApp->font());

if (m_24HourFormat) {
return fm.boundingRect("88:88\n8888/88/88").size() + QSize(20, 10);
return fm.boundingRect(this->rect(), Qt::AlignCenter, "88:88\n8888/88/88").size() + QSize(20, 10);
} else {
return fm.boundingRect("88:88 A.A.\n8888/88/88").size() + QSize(20, 20);
return fm.boundingRect(this->rect(), Qt::AlignCenter, "88:88 A.A.\n8888/88/88").size() + QSize(20, 20);
}
}

Expand Down

0 comments on commit 440255b

Please sign in to comment.