File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,6 @@ void QgsCollapsibleGroupBox::showEvent( QShowEvent * event )
85
85
event->accept ();
86
86
return ;
87
87
}
88
- mShown = true ;
89
88
90
89
// check if groupbox was set to flat in Designer or in code
91
90
mInitFlat = isFlat ();
@@ -111,11 +110,12 @@ void QgsCollapsibleGroupBox::showEvent( QShowEvent * event )
111
110
}
112
111
else
113
112
{
114
- /* manually expanding (already default) on show may scroll scroll areas;
115
- still emit signal for connections using expanded state */
113
+ // emit signal for connections using expanded state
116
114
emit collapsedStateChanged ( this );
117
115
}
118
-
116
+ // set mShown after first setCollapsed call or expanded groupboxes
117
+ // will scroll scroll areas when first shown
118
+ mShown = true ;
119
119
event->accept ();
120
120
}
121
121
@@ -292,7 +292,7 @@ void QgsCollapsibleGroupBox::setCollapsed( bool collapse )
292
292
mCollapseButton ->setIcon ( collapse ? mExpandIcon : mCollapseIcon );
293
293
294
294
// if expanding and is in a QScrollArea, scroll down to make entire widget visible
295
- if ( mScrollOnExpand && !collapse && mParentScrollArea )
295
+ if ( mShown && mScrollOnExpand && !collapse && mParentScrollArea )
296
296
{
297
297
// process events so entire widget is shown
298
298
QApplication::processEvents ();
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
48
48
void setScrollOnExpand ( bool scroll ) { mScrollOnExpand = scroll; }
49
49
50
50
signals:
51
- void collapsedStateChanged ( QWidget* );
51
+ /* * Signal emitted when groupbox collapsed/expanded state is changed, and when first shown */
52
+ void collapsedStateChanged ( QgsCollapsibleGroupBox* );
52
53
53
54
public slots:
54
55
void checkToggled ( bool ckd );
You can’t perform that action at this time.
0 commit comments