Skip to content

Commit

Permalink
Fix to enable QgsCollapsibleGroupBox disclosure triangle if widget wa…
Browse files Browse the repository at this point in the history
…s previously disabled
  • Loading branch information
dakcarto committed Sep 18, 2012
1 parent 396c431 commit babc12a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/qgscollapsiblegroupbox.cpp
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgscollapsiblegroupbox.h
Expand Up @@ -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;
Expand Down

0 comments on commit babc12a

Please sign in to comment.