diff options
author | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-09-24 19:56:23 +0200 |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com> | 2015-10-01 09:07:59 +0000 |
commit | b27a01a86e614207025e569926d0c419857e8965 (patch) | |
tree | 9d3dc7b339f3bc4ed7d2dcdaca17f091376b5aca /tests/auto/controls/data | |
parent | 79092d8ab8f5c02c5d880d33f9869c034f0f933d (diff) | |
download | qtquickcontrols-b27a01a86e614207025e569926d0c419857e8965.tar.gz |
Menus: Clean popup hide and destroy logic
When a menu popup gets closed it usually needs to be destroyed right away
since we don't recycle its contents. There is an exception, however, and
it's when he user triggers a menu item.
In this case, we need to proceed in three steps. First, we hide the menu
popup, then we emit the triggered signal, and when that one returns, the
menu contents can be disposed. If we did all in a single step, we may end
up with a crash since we don't support deleting a QtQuick item while it's
running a signal handler. Delayed deletions don't work either in the case
when the triggered handler ends up running the event loop.
Task-number: QTBUG-45182
Task-number: QTBUG-47682
Task-number: QTBUG-48382
Change-Id: Ic39717e09f38df602f641250cd81cf4931863db6
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data')
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 057ff471..da8c79f8 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -524,7 +524,7 @@ TestCase { verify(comboBox.data[menuIndex].__popupVisible) // close the menu before destroying the combobox - comboBox.data[menuIndex].__closeMenu() + comboBox.data[menuIndex].__closeAndDestroy() verify(!comboBox.data[menuIndex].__popupVisible) comboBox.destroy() @@ -550,7 +550,7 @@ TestCase { verify(comboBox.data[menuIndex].items[i].checked) } // close the menu before destroying the combobox - comboBox.data[menuIndex].__closeMenu() + comboBox.data[menuIndex].__closeAndDestroy() verify(!comboBox.data[menuIndex].__popupVisible) comboBox.destroy() } |