mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
Qt: Fix compilation on Qt <5.11
This commit is contained in:
parent
4b4b97540e
commit
681fccd5e6
|
@ -37,8 +37,13 @@ int MemoryViewWidget::asciiWidth() const
|
|||
|
||||
void MemoryViewWidget::updateMetrics()
|
||||
{
|
||||
m_char_width = fontMetrics().horizontalAdvance(QChar('0'));
|
||||
m_char_height = fontMetrics().height();
|
||||
const QFontMetrics fm(fontMetrics());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
m_char_width = fm.horizontalAdvance(QChar('0'));
|
||||
#else
|
||||
m_char_width = fm.boundingRect(QChar('0')).width();
|
||||
#endif
|
||||
m_char_height = fm.height();
|
||||
}
|
||||
|
||||
void MemoryViewWidget::setData(size_t address_offset, const void* data_ptr, size_t data_size)
|
||||
|
|
Loading…
Reference in a new issue