patch2.txt

Etienne Tourigny, 2013-02-11 09:38 AM

Download (38 KB)

 
1
diff --git a/python/gui/qgscollapsiblegroupbox.sip b/python/gui/qgscollapsiblegroupbox.sip
2
index 93b909d..1313529 100644
3
--- a/python/gui/qgscollapsiblegroupbox.sip
4
+++ b/python/gui/qgscollapsiblegroupbox.sip
5
@@ -1,3 +1,14 @@
6
+
7
+/**
8
+ * \class QgsCollapsibleGroupBox
9
+ * \brief A groupbox that collapses/expands when toggled.
10
+ *
11
+ * By default, it auto-saves its collapsed state to the global settings based on the widget and it's parent names.
12
+ *
13
+ * @note To add Collapsible properties in promoted QtDesigner widgets, you can add the following "Dynamic properties" by clicking on the green + in the propreties palette :
14
+ * bool collapsed, bool saveCollapsedState, bool saveCheckedState
15
+ */
16
+
17
 class QgsCollapsibleGroupBox : QGroupBox
18
 {
19
 %TypeHeaderCode
20
diff --git a/python/plugins/GdalTools/tools/widgetDEM.ui b/python/plugins/GdalTools/tools/widgetDEM.ui
21
index d0fe438..9483887 100644
22
--- a/python/plugins/GdalTools/tools/widgetDEM.ui
23
+++ b/python/plugins/GdalTools/tools/widgetDEM.ui
24
@@ -410,7 +410,7 @@
25
     </widget>
26
    </item>
27
    <item>
28
-    <widget class="QgsCollapsibleGroupBox" name="creationOptionsGroupBox">
29
+    <widget class="QgsCollapsibleGroupBox" name="creationOptionsGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
30
      <property name="enabled">
31
       <bool>true</bool>
32
      </property>
33
diff --git a/python/plugins/GdalTools/tools/widgetTranslate.ui b/python/plugins/GdalTools/tools/widgetTranslate.ui
34
index 47d4077..3b3d5dc 100644
35
--- a/python/plugins/GdalTools/tools/widgetTranslate.ui
36
+++ b/python/plugins/GdalTools/tools/widgetTranslate.ui
37
@@ -250,7 +250,7 @@ The 'gray' value (from GDAL 1.7.0) enables to expand a dataset with a color tabl
38
     </layout>
39
    </item>
40
    <item>
41
-    <widget class="QgsCollapsibleGroupBox" name="creationOptionsGroupBox">
42
+    <widget class="QgsCollapsibleGroupBox" name="creationOptionsGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
43
      <property name="title">
44
       <string>&amp;Creation Options</string>
45
      </property>
46
diff --git a/src/gui/qgscollapsiblegroupbox.cpp b/src/gui/qgscollapsiblegroupbox.cpp
47
index 7680564..0fc52e7 100644
48
--- a/src/gui/qgscollapsiblegroupbox.cpp
49
+++ b/src/gui/qgscollapsiblegroupbox.cpp
50
@@ -26,56 +26,33 @@
51
 #include <QSettings>
52
 #include <QScrollArea>
53
 
54
-QIcon QgsCollapsibleGroupBox::mCollapseIcon;
55
-QIcon QgsCollapsibleGroupBox::mExpandIcon;
56
+QIcon QgsCollapsibleGroupBoxBasic::mCollapseIcon;
57
+QIcon QgsCollapsibleGroupBoxBasic::mExpandIcon;
58
 
59
-QgsCollapsibleGroupBox::QgsCollapsibleGroupBox( QWidget *parent, QSettings* settings )
60
-    : QGroupBox( parent ), mSettings( settings )
61
+QgsCollapsibleGroupBoxBasic::QgsCollapsibleGroupBoxBasic( QWidget *parent )
62
+    : QGroupBox( parent )
63
 {
64
   init();
65
 }
66
 
67
-QgsCollapsibleGroupBox::QgsCollapsibleGroupBox( const QString &title,
68
-    QWidget *parent, QSettings* settings )
69
-    : QGroupBox( title, parent ), mSettings( settings )
70
+QgsCollapsibleGroupBoxBasic::QgsCollapsibleGroupBoxBasic( const QString &title,
71
+    QWidget *parent )
72
+    : QGroupBox( title, parent )
73
 {
74
   init();
75
 }
76
 
77
-QgsCollapsibleGroupBox::~QgsCollapsibleGroupBox()
78
+QgsCollapsibleGroupBoxBasic::~QgsCollapsibleGroupBoxBasic()
79
 {
80
-  saveState();
81
-  if ( mDelSettings ) // local settings obj to delete
82
-    delete mSettings;
83
-  mSettings = 0; // null the pointer (in case of outside settings obj)
84
+  QgsDebugMsg("Entered");
85
 }
86
 
87
 
88
-void QgsCollapsibleGroupBox::setSettings( QSettings* settings )
89
-{
90
-  if ( mDelSettings ) // local settings obj to delete
91
-    delete mSettings;
92
-  mSettings = settings;
93
-  mDelSettings = false; // don't delete outside obj
94
-}
95
-
96
-void QgsCollapsibleGroupBox::init()
97
+void QgsCollapsibleGroupBoxBasic::init()
98
 {
99
-  // use pointer to app qsettings if no custom qsettings specified
100
-  // custom qsettings object may be from Python plugin
101
-  mDelSettings = false;
102
-  if ( !mSettings )
103
-  {
104
-    mSettings = new QSettings();
105
-    mDelSettings = true; // only delete obj created by class
106
-  }
107
+  QgsDebugMsg("Entered");
108
   // variables
109
   mCollapsed = false;
110
-  mSaveCollapsedState = true;
111
-  // NOTE: only turn on mSaveCheckedState for groupboxes NOT used
112
-  // in multiple places or used as options for different parent objects
113
-  mSaveCheckedState = false;
114
-  mSettingGroup = ""; // if not set, use window object name
115
   mInitFlat = false;
116
   mScrollOnExpand = true;
117
   mShown = false;
118
@@ -101,8 +78,9 @@ void QgsCollapsibleGroupBox::init()
119
   connect( this, SIGNAL( toggled( bool ) ), this, SLOT( checkToggled( bool ) ) );
120
 }
121
 
122
-void QgsCollapsibleGroupBox::showEvent( QShowEvent * event )
123
+void QgsCollapsibleGroupBoxBasic::showEvent( QShowEvent * event )
124
 {
125
+  QgsDebugMsg("Entered");
126
   // initialise widget on first show event only
127
   if ( mShown )
128
   {
129
@@ -127,8 +105,6 @@ void QgsCollapsibleGroupBox::showEvent( QShowEvent * event )
130
     QgsDebugMsg( "did not find a QScrollArea parent" );
131
   }
132
 
133
-  loadState();
134
-
135
   updateStyle();
136
 
137
   // expand if needed - any calls to setCollapsed() before only set mCollapsed, but have UI effect
138
@@ -147,7 +123,7 @@ void QgsCollapsibleGroupBox::showEvent( QShowEvent * event )
139
   event->accept();
140
 }
141
 
142
-void QgsCollapsibleGroupBox::mouseReleaseEvent( QMouseEvent *event )
143
+void QgsCollapsibleGroupBoxBasic::mouseReleaseEvent( QMouseEvent *event )
144
 {
145
   // catch mouse release over title when non checkable, to collapse/expand
146
   if ( !isCheckable() && event->button() == Qt::LeftButton )
147
@@ -162,7 +138,7 @@ void QgsCollapsibleGroupBox::mouseReleaseEvent( QMouseEvent *event )
148
   QGroupBox::mouseReleaseEvent( event );
149
 }
150
 
151
-void QgsCollapsibleGroupBox::changeEvent( QEvent *event )
152
+void QgsCollapsibleGroupBoxBasic::changeEvent( QEvent *event )
153
 {
154
   // always re-enable mCollapseButton when groupbox was previously disabled
155
   // e.g. resulting from a disabled parent of groupbox, or a signal/slot connection
156
@@ -174,7 +150,7 @@ void QgsCollapsibleGroupBox::changeEvent( QEvent *event )
157
     mCollapseButton->setEnabled( true );
158
 }
159
 
160
-QRect QgsCollapsibleGroupBox::titleRect() const
161
+QRect QgsCollapsibleGroupBoxBasic::titleRect() const
162
 {
163
   QStyleOptionGroupBox box;
164
   initStyleOption( &box );
165
@@ -182,70 +158,7 @@ QRect QgsCollapsibleGroupBox::titleRect() const
166
                                   QStyle::SC_GroupBoxLabel, this );
167
 }
168
 
169
-QString QgsCollapsibleGroupBox::saveKey() const
170
-{
171
-  // save key for load/save state
172
-  // currently QgsCollapsibleGroupBox/window()/object
173
-  QString saveKey = "/" + objectName();
174
-  // QObject* parentWidget = parent();
175
-  // while ( parentWidget != NULL )
176
-  // {
177
-  //   saveKey = "/" + parentWidget->objectName() + saveKey;
178
-  //   parentWidget = parentWidget->parent();
179
-  // }
180
-  // if ( parent() != NULL )
181
-  //   saveKey = "/" + parent()->objectName() + saveKey;
182
-  QString setgrp = mSettingGroup.isEmpty() ? window()->objectName() : mSettingGroup;
183
-  saveKey = "/" + setgrp + saveKey;
184
-  saveKey = "QgsCollapsibleGroupBox" + saveKey;
185
-  return saveKey;
186
-}
187
-
188
-void QgsCollapsibleGroupBox::loadState()
189
-{
190
-  if ( !mSettings )
191
-    return;
192
-
193
-  if ( !isEnabled() || ( !mSaveCollapsedState && !mSaveCheckedState ) )
194
-    return;
195
-
196
-  setUpdatesEnabled( false );
197
-
198
-  QString key = saveKey();
199
-  QVariant val;
200
-  if ( mSaveCheckedState )
201
-  {
202
-    val = mSettings->value( key + "/checked" );
203
-    if ( ! val.isNull() )
204
-      setChecked( val.toBool() );
205
-  }
206
-  if ( mSaveCollapsedState )
207
-  {
208
-    val = mSettings->value( key + "/collapsed" );
209
-    if ( ! val.isNull() )
210
-      setCollapsed( val.toBool() );
211
-  }
212
-
213
-  setUpdatesEnabled( true );
214
-}
215
-
216
-void QgsCollapsibleGroupBox::saveState()
217
-{
218
-  if ( !mSettings )
219
-    return;
220
-
221
-  if ( !isEnabled() || ( !mSaveCollapsedState && !mSaveCheckedState ) )
222
-    return;
223
-
224
-  QString key = saveKey();
225
-
226
-  if ( mSaveCheckedState )
227
-    mSettings->setValue( key + "/checked", isChecked() );
228
-  if ( mSaveCollapsedState )
229
-    mSettings->setValue( key + "/collapsed", isCollapsed() );
230
-}
231
-
232
-void QgsCollapsibleGroupBox::checkToggled( bool chkd )
233
+void QgsCollapsibleGroupBoxBasic::checkToggled( bool chkd )
234
 {
235
   mCollapseButton->setEnabled( true ); // always keep enabled
236
   // expand/collapse when toggled
237
@@ -255,12 +168,12 @@ void QgsCollapsibleGroupBox::checkToggled( bool chkd )
238
     setCollapsed( true );
239
 }
240
 
241
-void QgsCollapsibleGroupBox::toggleCollapsed()
242
+void QgsCollapsibleGroupBoxBasic::toggleCollapsed()
243
 {
244
   setCollapsed( !mCollapsed );
245
 }
246
 
247
-void QgsCollapsibleGroupBox::updateStyle()
248
+void QgsCollapsibleGroupBoxBasic::updateStyle()
249
 {
250
   setUpdatesEnabled( false );
251
 
252
@@ -336,7 +249,7 @@ void QgsCollapsibleGroupBox::updateStyle()
253
   setUpdatesEnabled( true );
254
 }
255
 
256
-void QgsCollapsibleGroupBox::setCollapsed( bool collapse )
257
+void QgsCollapsibleGroupBoxBasic::setCollapsed( bool collapse )
258
 {
259
   mCollapsed = collapse;
260
 
261
@@ -364,3 +277,138 @@ void QgsCollapsibleGroupBox::setCollapsed( bool collapse )
262
   }
263
   emit collapsedStateChanged( this );
264
 }
265
+
266
+// ----
267
+
268
+QgsCollapsibleGroupBox::QgsCollapsibleGroupBox( QWidget *parent, QSettings* settings )
269
+    : QgsCollapsibleGroupBoxBasic( parent ), mSettings( settings )
270
+{
271
+  init();
272
+}
273
+
274
+QgsCollapsibleGroupBox::QgsCollapsibleGroupBox( const QString &title,
275
+    QWidget *parent, QSettings* settings )
276
+    : QgsCollapsibleGroupBoxBasic( title, parent ), mSettings( settings )
277
+{
278
+  init();
279
+}
280
+
281
+QgsCollapsibleGroupBox::~QgsCollapsibleGroupBox()
282
+{
283
+  QgsDebugMsg("Entered");
284
+  saveState();
285
+  if ( mDelSettings ) // local settings obj to delete
286
+    delete mSettings;
287
+  mSettings = 0; // null the pointer (in case of outside settings obj)
288
+}
289
+
290
+void QgsCollapsibleGroupBox::setSettings( QSettings* settings )
291
+{
292
+  if ( mDelSettings ) // local settings obj to delete
293
+    delete mSettings;
294
+  mSettings = settings;
295
+  mDelSettings = false; // don't delete outside obj
296
+}
297
+
298
+
299
+void QgsCollapsibleGroupBox::init()
300
+{
301
+  QgsDebugMsg("Entered");
302
+  // use pointer to app qsettings if no custom qsettings specified
303
+  // custom qsettings object may be from Python plugin
304
+  mDelSettings = false;
305
+  if ( !mSettings )
306
+  {
307
+    mSettings = new QSettings();
308
+    mDelSettings = true; // only delete obj created by class
309
+  }
310
+  // variables
311
+  mSaveCollapsedState = true;
312
+  // NOTE: only turn on mSaveCheckedState for groupboxes NOT used
313
+  // in multiple places or used as options for different parent objects
314
+  mSaveCheckedState = false;
315
+  mSettingGroup = ""; // if not set, use window object name
316
+  mShown = false;
317
+  mParentScrollArea = 0;
318
+}
319
+
320
+void QgsCollapsibleGroupBox::showEvent( QShowEvent * event )
321
+{
322
+  QgsDebugMsg("Entered");
323
+  // initialise widget on first show event only
324
+  if ( mShown )
325
+  {
326
+    event->accept();
327
+    return;
328
+  }
329
+
330
+  loadState();
331
+  
332
+  QgsCollapsibleGroupBoxBasic::showEvent( event );
333
+}
334
+
335
+QString QgsCollapsibleGroupBox::saveKey() const
336
+{
337
+  // save key for load/save state
338
+  // currently QgsCollapsibleGroupBoxBasic/window()/object
339
+  QString saveKey = "/" + objectName();
340
+  // QObject* parentWidget = parent();
341
+  // while ( parentWidget != NULL )
342
+  // {
343
+  //   saveKey = "/" + parentWidget->objectName() + saveKey;
344
+  //   parentWidget = parentWidget->parent();
345
+  // }
346
+  // if ( parent() != NULL )
347
+  //   saveKey = "/" + parent()->objectName() + saveKey;
348
+  QString setgrp = mSettingGroup.isEmpty() ? window()->objectName() : mSettingGroup;
349
+  saveKey = "/" + setgrp + saveKey;
350
+  saveKey = "QgsCollapsibleGroupBoxBasic" + saveKey;
351
+  return saveKey;
352
+}
353
+
354
+void QgsCollapsibleGroupBox::loadState()
355
+{
356
+  QgsDebugMsg("Entered");
357
+  if ( !mSettings )
358
+    return;
359
+
360
+  if ( !isEnabled() || ( !mSaveCollapsedState && !mSaveCheckedState ) )
361
+    return;
362
+
363
+  setUpdatesEnabled( false );
364
+
365
+  QString key = saveKey();
366
+  QVariant val;
367
+  if ( mSaveCheckedState )
368
+  {
369
+    val = mSettings->value( key + "/checked" );
370
+    if ( ! val.isNull() )
371
+      setChecked( val.toBool() );
372
+  }
373
+  if ( mSaveCollapsedState )
374
+  {
375
+    val = mSettings->value( key + "/collapsed" );
376
+    if ( ! val.isNull() )
377
+      setCollapsed( val.toBool() );
378
+  }
379
+
380
+  setUpdatesEnabled( true );
381
+}
382
+
383
+void QgsCollapsibleGroupBox::saveState()
384
+{
385
+  QgsDebugMsg("Entered");
386
+  if ( !mSettings )
387
+    return;
388
+
389
+  if ( !isEnabled() || ( !mSaveCollapsedState && !mSaveCheckedState ) )
390
+    return;
391
+
392
+  QString key = saveKey();
393
+
394
+  if ( mSaveCheckedState )
395
+    mSettings->setValue( key + "/checked", isChecked() );
396
+  if ( mSaveCollapsedState )
397
+    mSettings->setValue( key + "/collapsed", isCollapsed() );
398
+}
399
+
400
diff --git a/src/gui/qgscollapsiblegroupbox.h b/src/gui/qgscollapsiblegroupbox.h
401
index 0977ad3..7aaf518 100644
402
--- a/src/gui/qgscollapsiblegroupbox.h
403
+++ b/src/gui/qgscollapsiblegroupbox.h
404
@@ -20,11 +20,6 @@
405
 
406
 #include "qgisgui.h"
407
 
408
-/** \ingroup gui
409
- * A groupbox that collapses/expands when toggled.
410
- * @note Collapsible function not shown in promoted QtDesigner widgets.
411
- */
412
-
413
 #include <QGroupBox>
414
 #include <QSettings>
415
 #include <QPointer>
416
@@ -32,10 +27,74 @@
417
 class QToolButton;
418
 class QScrollArea;
419
 
420
-class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
421
+/** \ingroup gui
422
+ * A groupbox that collapses/expands when toggled.
423
+ * Basic class QgsCollapsibleGroupBoxBasic does not aut-save collapsed or checked state
424
+ * @note To add Collapsible properties in promoted QtDesigner widgets, you can add the following "Dynamic properties" by clicking on the green + in the propreties palette :
425
+ * bool collapsed
426
+ */
427
+
428
+class GUI_EXPORT QgsCollapsibleGroupBoxBasic : public QGroupBox
429
+{
430
+    Q_OBJECT
431
+
432
+    Q_PROPERTY(bool collapsed READ isCollapsed WRITE setCollapsed USER true)
433
+
434
+  public:
435
+    QgsCollapsibleGroupBoxBasic( QWidget *parent = 0 );
436
+    QgsCollapsibleGroupBoxBasic( const QString &title, QWidget *parent = 0 );
437
+    ~QgsCollapsibleGroupBoxBasic();
438
+
439
+    bool isCollapsed() const { return mCollapsed; }
440
+    void setCollapsed( bool collapse );
441
+
442
+    //! set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
443
+    void setScrollOnExpand( bool scroll ) { mScrollOnExpand = scroll; }
444
+
445
+  signals:
446
+    /** Signal emitted when groupbox collapsed/expanded state is changed, and when first shown */
447
+    void collapsedStateChanged( QgsCollapsibleGroupBoxBasic* );
448
+
449
+  public slots:
450
+    void checkToggled( bool ckd );
451
+    void toggleCollapsed();
452
+
453
+  protected:
454
+    void init();
455
+    void showEvent( QShowEvent *event );
456
+    void mouseReleaseEvent( QMouseEvent *event );
457
+    void changeEvent( QEvent *event );
458
+
459
+    void updateStyle();
460
+    QRect titleRect() const;
461
+
462
+    bool mCollapsed;
463
+    bool mInitFlat;
464
+    bool mScrollOnExpand;
465
+    bool mShown;
466
+    QScrollArea* mParentScrollArea;
467
+    QToolButton* mCollapseButton;
468
+
469
+    static QIcon mCollapseIcon;
470
+    static QIcon mExpandIcon;
471
+};
472
+
473
+/** \ingroup gui
474
+ * A groupbox that collapses/expands when toggled and can save its collapsed and checked states.
475
+ * By default, it auto-saves its collapsed and checked states to the global settings based on the widget and it's parent names.
476
+ * @see basic class QgsCollapsibleGroupBoxBasic which does not save collapsed or checked state
477
+ * @note To add Collapsible properties in promoted QtDesigner widgets, you can add the following "Dynamic properties" by clicking on the green + in the propreties palette :
478
+ * bool collapsed, bool saveCollapsedState, bool saveCheckedState
479
+ */
480
+
481
+class GUI_EXPORT QgsCollapsibleGroupBox : public QgsCollapsibleGroupBoxBasic
482
 {
483
     Q_OBJECT
484
 
485
+    Q_PROPERTY(bool collapsed READ isCollapsed WRITE setCollapsed USER true)
486
+    Q_PROPERTY(bool saveCollapsedState READ saveCollapsedState WRITE setSaveCollapsedState USER true)
487
+    Q_PROPERTY(bool saveCheckedState READ saveCheckedState WRITE setSaveCheckedState USER true)
488
+
489
   public:
490
     QgsCollapsibleGroupBox( QWidget *parent = 0, QSettings* settings = 0 );
491
     QgsCollapsibleGroupBox( const QString &title, QWidget *parent = 0, QSettings* settings = 0 );
492
@@ -44,9 +103,6 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
493
     // set custom QSettings pointer if group box was already created from QtDesigner promotion
494
     void setSettings( QSettings* settings );
495
 
496
-    bool isCollapsed() const { return mCollapsed; }
497
-    void setCollapsed( bool collapse );
498
-
499
     //! set this to false to not save/restore collapsed state
500
     void setSaveCollapsedState( bool save ) { mSaveCollapsedState = save; }
501
     /** set this to true to save/restore checked state
502
@@ -60,17 +116,6 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
503
     void setSettingGroup( const QString &group ) { mSettingGroup = group; }
504
     QString settingGroup() const { return mSettingGroup; }
505
 
506
-    //! set this to false to not automatically scroll parent QScrollArea to this widget's contents when expanded
507
-    void setScrollOnExpand( bool scroll ) { mScrollOnExpand = scroll; }
508
-
509
-  signals:
510
-    /** Signal emitted when groupbox collapsed/expanded state is changed, and when first shown */
511
-    void collapsedStateChanged( QgsCollapsibleGroupBox* );
512
-
513
-  public slots:
514
-    void checkToggled( bool ckd );
515
-    void toggleCollapsed();
516
-
517
   protected slots:
518
     void loadState();
519
     void saveState();
520
@@ -78,11 +123,6 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
521
   protected:
522
     void init();
523
     void showEvent( QShowEvent *event );
524
-    void mouseReleaseEvent( QMouseEvent *event );
525
-    void changeEvent( QEvent *event );
526
-
527
-    void updateStyle();
528
-    QRect titleRect() const;
529
     QString saveKey() const;
530
 
531
     // pointer to app or custom, external QSettings
532
@@ -90,18 +130,9 @@ class GUI_EXPORT QgsCollapsibleGroupBox : public QGroupBox
533
     QPointer<QSettings> mSettings;
534
     bool mDelSettings;
535
 
536
-    bool mCollapsed;
537
     bool mSaveCollapsedState;
538
     bool mSaveCheckedState;
539
     QString mSettingGroup;
540
-    bool mInitFlat;
541
-    bool mScrollOnExpand;
542
-    bool mShown;
543
-    QScrollArea* mParentScrollArea;
544
-    QToolButton* mCollapseButton;
545
-
546
-    static QIcon mCollapseIcon;
547
-    static QIcon mExpandIcon;
548
 };
549
 
550
 #endif
551
diff --git a/src/ui/qgscomposeritemwidgetbase.ui b/src/ui/qgscomposeritemwidgetbase.ui
552
index 720bba5..5f418ea 100644
553
--- a/src/ui/qgscomposeritemwidgetbase.ui
554
+++ b/src/ui/qgscomposeritemwidgetbase.ui
555
@@ -25,7 +25,7 @@
556
     </widget>
557
    </item>
558
    <item row="1" column="0" colspan="2">
559
-    <widget class="QgsCollapsibleGroupBox" name="mFrameGroupBox">
560
+    <widget class="QgsCollapsibleGroupBox" name="mFrameGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
561
      <property name="title">
562
       <string>Show frame</string>
563
      </property>
564
@@ -60,7 +60,7 @@
565
     </widget>
566
    </item>
567
    <item row="2" column="0" colspan="2">
568
-    <widget class="QgsCollapsibleGroupBox" name="mBackgroundGroupBox">
569
+    <widget class="QgsCollapsibleGroupBox" name="mBackgroundGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
570
      <property name="title">
571
       <string>Show background</string>
572
      </property>
573
diff --git a/src/ui/qgslabelingguibase.ui b/src/ui/qgslabelingguibase.ui
574
index 82d7461..92c9226 100644
575
--- a/src/ui/qgslabelingguibase.ui
576
+++ b/src/ui/qgslabelingguibase.ui
577
@@ -169,7 +169,7 @@
578
          <property name="childrenCollapsible">
579
           <bool>false</bool>
580
          </property>
581
-         <widget class="QgsCollapsibleGroupBox" name="groupBox_mPreview">
582
+         <widget class="QgsCollapsibleGroupBox" name="groupBox_mPreview"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
583
           <property name="sizePolicy">
584
            <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
585
             <horstretch>0</horstretch>
586
@@ -462,7 +462,7 @@
587
              <number>20</number>
588
             </property>
589
             <item row="9" column="0">
590
-             <widget class="QgsCollapsibleGroupBox" name="chkFormattedNumbers">
591
+             <widget class="QgsCollapsibleGroupBox" name="chkFormattedNumbers"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
592
               <property name="sizePolicy">
593
                <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
594
                 <horstretch>0</horstretch>
595
@@ -529,7 +529,7 @@
596
              </widget>
597
             </item>
598
             <item row="7" column="0">
599
-             <widget class="QgsCollapsibleGroupBox" name="mFontMultiLineGroupBox">
600
+             <widget class="QgsCollapsibleGroupBox" name="mFontMultiLineGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
601
               <property name="minimumSize">
602
                <size>
603
                 <width>0</width>
604
@@ -677,7 +677,7 @@
605
              </widget>
606
             </item>
607
             <item row="2" column="0">
608
-             <widget class="QgsCollapsibleGroupBox" name="mFontStyleGroupBox">
609
+             <widget class="QgsCollapsibleGroupBox" name="mFontStyleGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
610
               <property name="sizePolicy">
611
                <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
612
                 <horstretch>0</horstretch>
613
@@ -1161,7 +1161,7 @@
614
              </widget>
615
             </item>
616
             <item row="4" column="0">
617
-             <widget class="QgsCollapsibleGroupBox" name="chkBuffer">
618
+             <widget class="QgsCollapsibleGroupBox" name="chkBuffer"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
619
               <property name="sizePolicy">
620
                <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
621
                 <horstretch>0</horstretch>
622
@@ -1412,7 +1412,7 @@
623
              </spacer>
624
             </item>
625
             <item row="6" column="0">
626
-             <widget class="QgsCollapsibleGroupBox" name="mFontLimitPixelGroupBox">
627
+             <widget class="QgsCollapsibleGroupBox" name="mFontLimitPixelGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
628
               <property name="title">
629
                <string>Pixel size-based visibility</string>
630
               </property>
631
@@ -1550,7 +1550,7 @@
632
              </widget>
633
             </item>
634
             <item row="5" column="0">
635
-             <widget class="QgsCollapsibleGroupBox" name="chkScaleBasedVisibility">
636
+             <widget class="QgsCollapsibleGroupBox" name="chkScaleBasedVisibility"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
637
               <property name="sizePolicy">
638
                <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
639
                 <horstretch>0</horstretch>
640
@@ -1691,7 +1691,7 @@
641
              </widget>
642
             </item>
643
             <item row="8" column="0">
644
-             <widget class="QgsCollapsibleGroupBox" name="mDirectSymbGroupBox">
645
+             <widget class="QgsCollapsibleGroupBox" name="mDirectSymbGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
646
               <property name="title">
647
                <string>Line direction symbols</string>
648
               </property>
649
@@ -1929,7 +1929,7 @@
650
             <number>6</number>
651
            </property>
652
            <item row="1" column="0">
653
-            <widget class="QgsCollapsibleGroupBox" name="mPriorityGroupBox">
654
+            <widget class="QgsCollapsibleGroupBox" name="mPriorityGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
655
              <property name="maximumSize">
656
               <size>
657
                <width>16777215</width>
658
@@ -1977,7 +1977,7 @@
659
             </widget>
660
            </item>
661
            <item row="0" column="0">
662
-            <widget class="QgsCollapsibleGroupBox" name="mPlacementGroupBox">
663
+            <widget class="QgsCollapsibleGroupBox" name="mPlacementGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
664
              <property name="sizePolicy">
665
               <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
666
                <horstretch>0</horstretch>
667
@@ -2731,7 +2731,7 @@
668
             </spacer>
669
            </item>
670
            <item row="2" column="0">
671
-            <widget class="QgsCollapsibleGroupBox" name="mOptionsGroupBox">
672
+            <widget class="QgsCollapsibleGroupBox" name="mOptionsGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
673
              <property name="maximumSize">
674
               <size>
675
                <width>16777215</width>
676
@@ -3003,7 +3003,7 @@
677
             <number>6</number>
678
            </property>
679
            <item row="3" column="0">
680
-            <widget class="QgsCollapsibleGroupBox" name="mBufferAttributesPropertiesGroupBox">
681
+            <widget class="QgsCollapsibleGroupBox" name="mBufferAttributesPropertiesGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
682
              <property name="title">
683
               <string>Buffer properties</string>
684
              </property>
685
@@ -3049,7 +3049,7 @@
686
             </widget>
687
            </item>
688
            <item row="4" column="0">
689
-            <widget class="QgsCollapsibleGroupBox" name="mPositionAttributeGroupBox">
690
+            <widget class="QgsCollapsibleGroupBox" name="mPositionAttributeGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
691
              <property name="title">
692
               <string>Position</string>
693
              </property>
694
@@ -3147,7 +3147,7 @@
695
             </spacer>
696
            </item>
697
            <item row="1" column="0">
698
-            <widget class="QgsCollapsibleGroupBox" name="mDisplayAttributesPropertiesGroupBox">
699
+            <widget class="QgsCollapsibleGroupBox" name="mDisplayAttributesPropertiesGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
700
              <property name="title">
701
               <string>Display properties</string>
702
              </property>
703
@@ -3211,7 +3211,7 @@
704
             </widget>
705
            </item>
706
            <item row="2" column="0">
707
-            <widget class="QgsCollapsibleGroupBox" name="mFontAttributePropertiesGroupBox">
708
+            <widget class="QgsCollapsibleGroupBox" name="mFontAttributePropertiesGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
709
              <property name="sizePolicy">
710
               <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
711
                <horstretch>0</horstretch>
712
diff --git a/src/ui/qgsoptionsbase.ui b/src/ui/qgsoptionsbase.ui
713
index cfa101c..9fa68fb 100644
714
--- a/src/ui/qgsoptionsbase.ui
715
+++ b/src/ui/qgsoptionsbase.ui
716
@@ -997,7 +997,7 @@
717
                    </widget>
718
                   </item>
719
                   <item row="2" column="0" colspan="4">
720
-                   <widget class="QgsCollapsibleGroupBox" name="mCurrentVariablesGrpBx">
721
+                   <widget class="QgsCollapsibleGroupBox" name="mCurrentVariablesGrpBx"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
722
                     <property name="minimumSize">
723
                      <size>
724
                       <width>0</width>
725
@@ -3790,7 +3790,7 @@
726
                 </widget>
727
                </item>
728
                <item>
729
-                <widget class="QgsCollapsibleGroupBox" name="grpProxy">
730
+                <widget class="QgsCollapsibleGroupBox" name="grpProxy"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
731
                  <property name="title">
732
                   <string>Use proxy for web access</string>
733
                  </property>
734
diff --git a/src/ui/qgsprojectpropertiesbase.ui b/src/ui/qgsprojectpropertiesbase.ui
735
index f963ddc..d7b385f 100644
736
--- a/src/ui/qgsprojectpropertiesbase.ui
737
+++ b/src/ui/qgsprojectpropertiesbase.ui
738
@@ -843,7 +843,7 @@
739
           </property>
740
           <layout class="QGridLayout" name="gridLayout_15">
741
            <item row="0" column="0">
742
-            <widget class="QgsCollapsibleGroupBox" name="grpOWSServiceCapabilities">
743
+            <widget class="QgsCollapsibleGroupBox" name="grpOWSServiceCapabilities"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
744
              <property name="title">
745
               <string>Service Capabilitities</string>
746
              </property>
747
@@ -979,7 +979,7 @@
748
              </property>
749
              <layout class="QGridLayout" name="gridLayout_14">
750
               <item row="0" column="0">
751
-               <widget class="QgsCollapsibleGroupBox" name="grpWMSExt">
752
+               <widget class="QgsCollapsibleGroupBox" name="grpWMSExt"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
753
                 <property name="title">
754
                  <string>Advertised Extent</string>
755
                 </property>
756
@@ -1082,7 +1082,7 @@
757
                </widget>
758
               </item>
759
               <item row="0" column="1" colspan="2">
760
-               <widget class="QgsCollapsibleGroupBox" name="grpWMSList">
761
+               <widget class="QgsCollapsibleGroupBox" name="grpWMSList"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
762
                 <property name="title">
763
                  <string>Coordinate Systems Restrictions</string>
764
                 </property>
765
@@ -1121,7 +1121,7 @@
766
                </widget>
767
               </item>
768
               <item row="1" column="0">
769
-               <widget class="QgsCollapsibleGroupBox" name="mWMSComposerGroupBox">
770
+               <widget class="QgsCollapsibleGroupBox" name="mWMSComposerGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
771
                 <property name="title">
772
                  <string>Exclude composers</string>
773
                 </property>
774
@@ -1174,7 +1174,7 @@
775
                </widget>
776
               </item>
777
               <item row="1" column="2">
778
-               <widget class="QgsCollapsibleGroupBox" name="mLayerRestrictionsGroupBox">
779
+               <widget class="QgsCollapsibleGroupBox" name="mLayerRestrictionsGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
780
                 <property name="title">
781
                  <string>Exclude layers</string>
782
                 </property>
783
diff --git a/src/ui/qgsrasterlayerpropertiesbase.ui b/src/ui/qgsrasterlayerpropertiesbase.ui
784
index 990e8db..9cb1e52 100644
785
--- a/src/ui/qgsrasterlayerpropertiesbase.ui
786
+++ b/src/ui/qgsrasterlayerpropertiesbase.ui
787
@@ -158,7 +158,7 @@
788
         </widget>
789
        </item>
790
        <item>
791
-        <widget class="QgsCollapsibleGroupBox" name="mResamplingGroupBox">
792
+        <widget class="QgsCollapsibleGroupBox" name="mResamplingGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
793
          <property name="title">
794
           <string>Resampling</string>
795
          </property>
796
diff --git a/src/ui/qgsrasterlayersaveasdialogbase.ui b/src/ui/qgsrasterlayersaveasdialogbase.ui
797
index cc5b759..ba30377 100644
798
--- a/src/ui/qgsrasterlayersaveasdialogbase.ui
799
+++ b/src/ui/qgsrasterlayersaveasdialogbase.ui
800
@@ -222,7 +222,7 @@ datasets with maximum width and height specified below.</string>
801
         <number>0</number>
802
        </property>
803
        <item>
804
-        <widget class="QgsCollapsibleGroupBox" name="mExtentGroupBox">
805
+        <widget class="QgsCollapsibleGroupBox" name="mExtentGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
806
          <property name="sizePolicy">
807
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
808
            <horstretch>0</horstretch>
809
@@ -380,7 +380,7 @@ datasets with maximum width and height specified below.</string>
810
         </widget>
811
        </item>
812
        <item>
813
-        <widget class="QgsCollapsibleGroupBox" name="mResolutionGroupBox">
814
+        <widget class="QgsCollapsibleGroupBox" name="mResolutionGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
815
          <property name="sizePolicy">
816
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
817
            <horstretch>0</horstretch>
818
@@ -465,7 +465,7 @@ datasets with maximum width and height specified below.</string>
819
         </widget>
820
        </item>
821
        <item>
822
-        <widget class="QgsCollapsibleGroupBox" name="mTilesGroupBox">
823
+        <widget class="QgsCollapsibleGroupBox" name="mTilesGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
824
          <property name="sizePolicy">
825
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
826
            <horstretch>0</horstretch>
827
@@ -520,7 +520,7 @@ datasets with maximum width and height specified below.</string>
828
         </widget>
829
        </item>
830
        <item>
831
-        <widget class="QgsCollapsibleGroupBox" name="mCreateOptionsGroupBox">
832
+        <widget class="QgsCollapsibleGroupBox" name="mCreateOptionsGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
833
          <property name="sizePolicy">
834
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
835
            <horstretch>0</horstretch>
836
@@ -544,7 +544,7 @@ datasets with maximum width and height specified below.</string>
837
         </widget>
838
        </item>
839
        <item>
840
-        <widget class="QgsCollapsibleGroupBox" name="mPyramidsGroupBox">
841
+        <widget class="QgsCollapsibleGroupBox" name="mPyramidsGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
842
          <property name="sizePolicy">
843
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
844
            <horstretch>0</horstretch>
845
@@ -628,7 +628,7 @@ datasets with maximum width and height specified below.</string>
846
         </widget>
847
        </item>
848
        <item>
849
-        <widget class="QgsCollapsibleGroupBox" name="mNoDataGroupBox">
850
+        <widget class="QgsCollapsibleGroupBox" name="mNoDataGroupBox"><property name="collapsed" stdset="0"><bool>false</bool></property><property name="saveCheckedState" stdset="0"><bool>false</bool></property><property name="saveCollapsedState" stdset="0"><bool>true</bool></property>
851
          <property name="sizePolicy">
852
           <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
853
            <horstretch>0</horstretch>
854
diff --git a/tests/testdata/zip/testzip.zip b/tests/testdata/zip/testzip.zip
855
index 47d83b3..1a3dc68 100644
856
Binary files a/tests/testdata/zip/testzip.zip and b/tests/testdata/zip/testzip.zip differ