fix placement of placeholder text in QLineEdits with action icons
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Mon, 21 Feb 2022 21:00:28 +0000 (21:00 +0000)
committerDmitry Shachnev <mitya57@debian.org>
Mon, 21 Feb 2022 21:00:28 +0000 (21:00 +0000)
commitccd51f6fa9896744759bb9dd2bc0c3a2c801595c
tree1e53bda4479e7b9e0593762a1799f4bd318b4538
parent3c7cb41063a0fa7f722eb761c1248cc77282c250
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