forked from qt-creator/qt-creator
ProjectExplorer: Make project window state persistent
Task-number: QTCREATORBUG-24690 Change-Id: Ia261fc5a98681676e8d67e6d840f2f48073cdbb2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -661,8 +661,38 @@ void ProjectWindow::activateProjectPanel(Utils::Id panelId)
|
||||
d->activateProjectPanel(panelId);
|
||||
}
|
||||
|
||||
void ProjectWindow::hideEvent(QHideEvent *event)
|
||||
{
|
||||
savePersistentSettings();
|
||||
FancyMainWindow::hideEvent(event);
|
||||
}
|
||||
|
||||
void ProjectWindow::showEvent(QShowEvent *event)
|
||||
{
|
||||
loadPersistentSettings();
|
||||
FancyMainWindow::showEvent(event);
|
||||
}
|
||||
|
||||
ProjectWindow::~ProjectWindow() = default;
|
||||
|
||||
const char PROJECT_WINDOW_KEY[] = "ProjectExplorer.ProjectWindow";
|
||||
|
||||
void ProjectWindow::savePersistentSettings() const
|
||||
{
|
||||
QSettings * const settings = ICore::settings();
|
||||
settings->beginGroup(PROJECT_WINDOW_KEY);
|
||||
saveSettings(settings);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
void ProjectWindow::loadPersistentSettings()
|
||||
{
|
||||
QSettings * const settings = ICore::settings();
|
||||
settings->beginGroup(PROJECT_WINDOW_KEY);
|
||||
restoreSettings(settings);
|
||||
settings->endGroup();
|
||||
}
|
||||
|
||||
QSize SelectorDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
|
||||
{
|
||||
QSize s = QStyledItemDelegate::sizeHint(option, index);
|
||||
|
||||
Reference in New Issue
Block a user