qt6-bb10/tests/auto/widgets
Axel Spoerl 729e23f15f QPlainTextEdit: update viewport, when placeholder text disappears
QPlainTextEditPrivate::updatePlaceholderVisibility() issued a full
viewport update, when the document became empty and the placeholder text
needed to be shown. No update was issued, when the placeholder text was
replaced by a first text character entered.
That relied on the assumption, that the placeholder text would disappear
with the first text line being rendered (even if it has just one char).

When the placeholder text covered multiple line, only the first of them
disappeared.

This patch adds a boolean to remember, that the placeholder text is
shown. If that is the case and the first char is entered, a full update
is issued, to remove all lines of the placeholder text. The boolean flag
is cleared thereafter, to avoid unnecessary viewport updates.

isPlaceHolderTextVisible() is renamed into placeHolderTextToBeShown(),
because the method returns an instruction, rather than a state.

tst_QPlainTextEdit::placeholderVisibility() is adapted to test the
boolean flag, hence the real visibility of the placeholder text.
That extends its scope to the bug at hand.

Fixes: QTBUG-119808
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I07a7059ae619dc85d0c21247d829120e6afa7115
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-12-21 21:38:26 +01:00
..
dialogs QDialogButtonBox: Fix focus chain and default button assignment 2023-12-20 17:16:53 +01:00
effects Stabilize tst_QGraphicsEffect::draw() 2023-08-25 09:04:37 +02:00
graphicsview Android: Skip focusProxy_QTBUG_51856() test case temporarily 2023-12-07 10:56:43 +02:00
itemviews QAIV: reset state if removing index while editing or committing 2023-12-14 22:59:33 +01:00
kernel QWindowContainer: Don't embed a QWidget 2023-12-21 18:49:29 +00:00
styles Reset palette resolve mask in windows vista style 2023-09-05 10:59:00 +02:00
util Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
widgets QPlainTextEdit: update viewport, when placeholder text disappears 2023-12-21 21:38:26 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00