qt5base-lts/tests/auto/widgets
Graham Coleman 92b2275c3d remove finishEdit() call, fix double textChanged on delete
There is a known bug where duplicate textChanged signals are
triggered on backspace/delete. The bug has been seen on Windows,
Mac, and Linux. Gabi showed that this duplicate signal is caused by
two calls to finishEdit(), one direct and one nested,
in QTextCursorPrivate::remove().

To attempt a fix, I removed the direct call and do not change the
nested call. This change only affects text buffers when they
receive remove commands.

This seems to fix the problem, shown by the test project
uploaded to the bug tracker and also in countTextChangedOnRemove
in tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp.

Further analysis of finishEdit() and QTextCursorPrivate::remove():
finishEdit() calls signals contentsChanged() as long as a valid block
is being edited. Remove() calls finishEdit for all non-table edits,
so finishEdit will be called for most cases.

Methods in the public QTextCursor all seem to set adjusted_anchor
and anchor, none reading it directly, so I haven't found publicly
observable consequences to "adjusted_anchor = anchor = position;".

Task-number: QTBUG-15003
Change-Id: Ic35f25ee81c4007867b47cd8be03c146a673f86d
Reviewed-by: Graham Coleman <ravelite@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2013-11-21 18:30:05 +01:00
..
dialogs QPrintSupport: Move QAbstractPrintDialog test into QPrintSupport 2013-10-26 00:39:51 +02:00
effects QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
graphicsview Merge remote-tracking branch 'origin/stable' into dev 2013-10-24 12:48:42 +02:00
itemviews Compare QIcon QVariants by their cache key 2013-10-09 13:15:54 +02:00
kernel compile fix if no QFileSystemWatcher is available 2013-11-07 11:16:12 +01:00
styles Test password mask delay and characters on Mac. 2013-07-11 10:56:49 +02:00
util QCompleter::setFilterMode() add property filterMode. 2013-09-20 23:45:06 +02:00
widgets remove finishEdit() call, fix double textChanged on delete 2013-11-21 18:30:05 +01:00
widgets.pro Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00