Keep compatibility with Qt < 5.11

This commit is contained in:
Martchus 2022-12-20 23:03:34 +01:00 committed by Fabien Givors
parent 3948644150
commit 8fa59cbec1
1 changed files with 3 additions and 0 deletions

View File

@ -281,6 +281,9 @@ void GuiSidePanel::updateTranslate(){
int delta = 0;
QFontMetrics fm(w->font());
#if (QT_VERSION < QT_VERSION_CHECK(5, 11, 0)) // keep compat with Qt < 5.11
#define horizontalAdvance width
#endif
auto *const lb = qobject_cast<QLabel*>(w);
if (lb) delta=fm.horizontalAdvance(lb->text())-lb->width();