fix placement of placeholder text in QLineEdits with action icons
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Mon, 13 Jun 2022 18:00:47 +0000 (19:00 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Mon, 13 Jun 2022 18:00:47 +0000 (19:00 +0100)
commitbed966493b493ca7843965ccc35aa6df00c252ba
treefbdba1e6b7a82a8be5a00073465659e6cfd9bc12
parent75566673c75bb7115517a56da792e6208229ff27
fix placement of placeholder text in QLineEdits with action icons

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=0e6b31019f01c72e
Last-Update: 2021-08-10

After dc794f7622bc00f7ca50fab65d6965695d6d2972, side widgets only got
space if they were not fading out, but the logic was not correctly
accounting for side widgets that never fade, such as buttons added via
QLineEdit::addAction.

Fix this to give visible widgets space, unless they are fading out. That
was the intent of the original change. Rename the variable to make its
purpose clearer, and reset it at the end of the fade-out animation.

Add a much-needed test that relies on private APIs to verify that the
effective margins are calculated correctly.

Gbp-Pq: Name fix-placement-of-placeholder-text-in-QLineEdits-with-action-icons.diff
src/widgets/widgets/qlineedit_p.cpp
src/widgets/widgets/qlineedit_p.h
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp