qt6-bb10/tests/auto/widgets/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
..
qabstractbutton CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qabstractscrollarea QAbstractScrollArea: Don't include size of invisible scrollbars 2023-07-11 01:34:19 +02:00
qabstractslider CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qabstractspinbox CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qbuttongroup CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qcalendarwidget CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qcheckbox QCheckBox: Don't emit checkStateChanged when nothing changed 2023-11-08 11:11:48 +01:00
qcombobox QComboBox: don't eat non-printable key strokes 2023-11-23 10:33:28 +00:00
qcommandlinkbutton CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qdatetimeedit Suppress deprecation warnings in test of QDTE::timeSpec property 2023-10-26 16:57:01 +02:00
qdial QDial: don't crash when min==max and setting a value != min & max 2023-11-12 23:45:30 +01:00
qdialogbuttonbox Explicitly focus automatic default button in QDialogButtonBox inside dialog 2023-10-26 00:14:33 +02:00
qdockwidget QDockWidget: Fix group unplugging 2023-11-18 20:48:44 +01:00
qdoublespinbox CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qfocusframe CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qfontcombobox CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qframe CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qgroupbox tst_QGroupBox: port away from Q_FOREACH 2023-08-07 21:56:10 +00:00
qkeysequenceedit CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qlabel CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qlcdnumber CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qlineedit QLineEdit: Use existing selection when deleting a word 2023-12-14 19:25:16 +00:00
qmainwindow QMainWindow: don't crash when restored state is modified before applied 2023-12-13 15:15:24 +01:00
qmdiarea Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
qmdisubwindow CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qmenu CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qmenubar Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
qopenglwidget Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
qplaintextedit QPlainTextEdit: update viewport, when placeholder text disappears 2023-12-21 21:38:26 +01:00
qprogressbar CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qpushbutton CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qradiobutton CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qrhiwidget Enable QWidget::grab() with QRhiWidget in the widget tree 2023-08-28 21:14:28 +02:00
qscrollarea CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qscrollbar CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qsizegrip CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qslider CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qspinbox Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
qsplashscreen QSplashScreen: Enforce visibility by processing events 2023-12-14 20:25:16 +01:00
qsplitter tst_QSplitter: fix compiler warning 2023-09-01 00:11:51 +02:00
qstackedwidget CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qstatusbar CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qtabbar QTabBar: properly calc tab positions when changing tab position 2023-12-07 08:41:01 +01:00
qtabwidget QTabWidget/Bar: ignore hidden tabs for key events 2023-11-09 20:57:43 +01:00
qtextbrowser CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qtextedit QtWidgets tests: port remaining users away from Q_FOREACH 2023-08-14 23:11:54 +03:00
qtoolbar CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qtoolbox CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qtoolbutton CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt QSplashScreen: Enforce visibility by processing events 2023-12-14 20:25:16 +01:00