mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
port away from deprecated API from QFontMetricsF
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
d035c26be5
commit
20ee506b71
1 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ void PostfixLineEdit::setPostfix(const QString &postfix)
|
|||
_postfix = postfix;
|
||||
QFontMetricsF fm(font());
|
||||
QMargins tm = textMargins();
|
||||
tm.setRight(tm.right() + qRound(fm.width(_postfix)) + verticalMargin);
|
||||
tm.setRight(tm.right() + qRound(fm.horizontalAdvance(_postfix)) + verticalMargin);
|
||||
setTextMargins(tm);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ void PostfixLineEdit::paintEvent(QPaintEvent *pe)
|
|||
//
|
||||
p.setPen(palette().color(QPalette::Disabled, QPalette::Text));
|
||||
QFontMetricsF fm(font());
|
||||
int start = rect().right() - qRound(fm.width(_postfix));
|
||||
int start = rect().right() - qRound(fm.horizontalAdvance(_postfix));
|
||||
QStyleOptionFrame panel;
|
||||
initStyleOption(&panel);
|
||||
QRect r = style()->subElementRect(QStyle::SE_LineEditContents, &panel, this);
|
||||
|
|
Loading…
Reference in a new issue