qt6-bb10/tests/auto/widgets/widgets/qcombobox
Marc Mutz 631b143b3f QComboBox: fix crash on setEditable(false) called from editTextChanged()
QLineEdit::setText() emits QLineEdit::textChanged(), which is
connected to QComboBox::editTextChanged(). When a user slot
connected to editTextChanged() sets QComboBox::editable to
false, the line edit will be deleted in setEditable() and
when control returns to QComboBoxPrivate::setCurrentIndex(),
the formerly non-null 'lineEdit' has changed to nullptr,
leading to a nullptr dereference when attempting to set the
completionPrefix on lineEdit->completer().

Fix by re-checking 'lineEdit' after returning from the
QLineEdit::setText() call.

Add a test.

Task-number: QTBUG-54191
Change-Id: I94154796cfde73fb490f8471c48b9d6f62825a92
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-07-06 10:34:43 +00:00
..
.gitignore Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
BLACKLIST Tests: Blacklist task260974_menuItemRectangleForComboBoxPopup 2015-04-24 13:43:06 +00:00
qcombobox.pro Set the Qt API level to compatibility mode in all tests. 2012-08-01 15:37:46 +02:00
qtlogo.png Fix QComboBox icon testing 2012-10-16 10:47:41 +02:00
qtlogoinverted.png Purge sRGB chunks from PNGs in tests. 2016-03-29 08:39:43 +00:00
tst_qcombobox.cpp QComboBox: fix crash on setEditable(false) called from editTextChanged() 2016-07-06 10:34:43 +00:00