Skip to content
Permalink
Browse files

Fix to enable QgsCollapsibleGroupBox disclosure triangle if widget wa…

…s previously disabled
  • Loading branch information
dakcarto committed Sep 18, 2012
1 parent 396c431 commit babc12a5ceb0b182f0c41d914345d4b6dc78ed65
Showing with 14 additions and 0 deletions.
  1. +12 −0 src/gui/qgscollapsiblegroupbox.cpp
  2. +2 −0 src/gui/qgscollapsiblegroupbox.h
@@ -134,6 +134,18 @@ void QgsCollapsibleGroupBox::mouseReleaseEvent( QMouseEvent *event )
QGroupBox::mouseReleaseEvent( event );
}

void QgsCollapsibleGroupBox::changeEvent( QEvent *event )
{
// always re-enable mCollapseButton when groupbox was previously disabled
// e.g. resulting from a disabled parent of groupbox, or a signal/slot connection

// default behaviour - pass to QGroupBox
QGroupBox::changeEvent( event );

if ( event->type() == QEvent::EnabledChange && isEnabled() )
mCollapseButton->setEnabled( true );
}

QRect QgsCollapsibleGroupBox::titleRect() const
{
QStyleOptionGroupBox box;
@@ -63,6 +63,8 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
void init();
void showEvent( QShowEvent *event );
void mouseReleaseEvent( QMouseEvent *event );
void changeEvent( QEvent *event );

void updateStyle();
QRect titleRect() const;
QString saveKey() const;

0 comments on commit babc12a

Please sign in to comment.
You can’t perform that action at this time.