Fixes the storage of the windows state for invisible windows

Until now windows/widgets that were invisible during the call to
MainWindow::saveWidgetState had their size stored as (0, 0). This
resulted in problems when the default template was created with
invisible windows because in new projects these windows then opened up
at a very small size.

This patch fixes the problem by introducing a new parameter of type
QSize to MainWindow::saveWidgetState. It can be used to communicate the
size that should be stored in case the widget that calls the method is
invisible. The code of most callers (PianoRollWindow, SongEditor, etc.)
has been updated to use good default sizes.
This commit is contained in:
Michael Gregorius
2015-09-17 17:48:37 +02:00
parent 09bc6f158a
commit 7881e0315d
8 changed files with 14 additions and 11 deletions

View File

@@ -99,7 +99,7 @@ public:
return m_keyMods.m_alt;
}
static void saveWidgetState( QWidget * _w, QDomElement & _de );
static void saveWidgetState( QWidget * _w, QDomElement & _de, QSize const & sizeIfInvisible = QSize(0, 0) );
static void restoreWidgetState( QWidget * _w, const QDomElement & _de );
public slots: