Skip to content
Permalink
Browse files
don't close popup after first click, so user can select all necessary
options at once
  • Loading branch information
alexbruy committed Apr 8, 2017
1 parent 9fbb31a commit 1e3baca361c6088634b4a078d9a10644878ace29
Showing with 9 additions and 2 deletions.
  1. +7 −2 src/gui/qgscheckablecombobox.cpp
  2. +2 −0 src/gui/qgscheckablecombobox.h
@@ -169,10 +169,11 @@ void QgsCheckableComboBox::toggleItemCheckState( int index )

void QgsCheckableComboBox::hidePopup()
{
if ( !view()->underMouse() )
if ( !mSkipHide )
{
QComboBox::hidePopup();
}
mSkipHide = false;
}

void QgsCheckableComboBox::showContextMenu( const QPoint &pos )
@@ -206,7 +207,11 @@ void QgsCheckableComboBox::deselectAllOptions()

bool QgsCheckableComboBox::eventFilter( QObject *object, QEvent *event )
{
Q_UNUSED( object );
if ( ( event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease )
&& object == view()->viewport() )
{
mSkipHide = true;
}

if ( event->type() == QEvent::MouseButtonRelease )
{
@@ -227,6 +227,8 @@ class GUI_EXPORT QgsCheckableComboBox : public QComboBox
QString mSeparator;
QString mDefaultText;

bool mSkipHide = false;

QMenu *mContextMenu = nullptr;
QAction *mSelectAllAction = nullptr;
QAction *mDeselectAllAction = nullptr;

0 comments on commit 1e3baca

Please sign in to comment.