diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-09-09 11:36:32 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-09-09 11:36:32 (GMT) |
commit | 8ed2b25f87bc632d0e7d375c3506fab1c59ca1a2 (patch) | |
tree | e7c29e3933f84779a7ea4382e7a80fe42005f906 /src/gui/widgets/qcombobox.cpp | |
parent | 647a3999bb073395ebb3df2137fb60e5b0435d16 (diff) | |
download | Qt-8ed2b25f87bc632d0e7d375c3506fab1c59ca1a2.zip Qt-8ed2b25f87bc632d0e7d375c3506fab1c59ca1a2.tar.gz Qt-8ed2b25f87bc632d0e7d375c3506fab1c59ca1a2.tar.bz2 |
Editable QComboBox popup immediately closes itself after a click
This is due that timer that blocks for while mouse release events
(blockMouseReleaseTimer) is not started. There is an optimization
in QComboBox that tries to avoid calling d->viewContainer() since
that method creates the viewContainter if it doesn't exist.
Unfortunately this optimization does not take into account if the
container is already created.
In this particular case, viewContainer is already created, but
since QComboBox creates a QLineEdit, it skips the timer start,
which leads to situation where combobox's popup menu receiving
mouse release event and thus closes itself.
As a fix, blockMouseReleaseTimer is started if the viewContainer is
already created.
Task-number: QTBUG-13231
Reviewed-by: axis
Diffstat (limited to 'src/gui/widgets/qcombobox.cpp')
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 917a325..96d2acd 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -2849,7 +2849,8 @@ void QComboBox::mousePressEvent(QMouseEvent *e) if (sc == QStyle::SC_ComboBoxArrow) d->updateArrow(QStyle::State_Sunken); #ifdef QT_KEYPAD_NAVIGATION - if (!d->lineEdit) { + //if the container already exists, then d->viewContainer() is safe to call + if (d->container) { #endif // We've restricted the next couple of lines, because by not calling // viewContainer(), we avoid creating the QComboBoxPrivateContainer. |