summaryrefslogtreecommitdiff
path: root/src/plugins/designer/editorwidget.cpp
diff options
context:
space:
mode:
authorLasse Holmstedt <lasse.holmstedt@nokia.com>2010-02-26 11:08:17 +0100
committerLasse Holmstedt <lasse.holmstedt@nokia.com>2010-02-26 11:17:02 +0100
commitdf7a19de9ecbb88a814bba376fc1f5f6c820eb0f (patch)
tree491850090fe1b6b9ba028a907104ede15fb3f892 /src/plugins/designer/editorwidget.cpp
parent57ee6f0748b5c7471839c2e4d32e8e43cf74b25a (diff)
downloadqt-creator-df7a19de9ecbb88a814bba376fc1f5f6c820eb0f.tar.gz
Design mode integration
Moved Qt Designer to open from Design Mode. Also, Design mode is now global, and created in coreplugin. Other plugins can register themselves to it.
Diffstat (limited to 'src/plugins/designer/editorwidget.cpp')
-rw-r--r--src/plugins/designer/editorwidget.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/designer/editorwidget.cpp b/src/plugins/designer/editorwidget.cpp
index c12a076100..0b8ad8e089 100644
--- a/src/plugins/designer/editorwidget.cpp
+++ b/src/plugins/designer/editorwidget.cpp
@@ -97,6 +97,7 @@ EditorWidget::EditorWidget(QWidget *formWindow)
// Get shared sub windows from Form Editor
FormEditorW *few = FormEditorW::instance();
QWidget * const*subs = few->designerSubWindows();
+
// Create shared sub windows
for (int i=0; i < DesignerSubWindowCount; i++) {
m_designerSubWindows[i] = new SharedSubWindow(subs[i]);
@@ -132,6 +133,13 @@ void EditorWidget::resetToDefaultLayout()
void EditorWidget::activate()
{
+ /*
+
+ - now, settings are only changed when form is hidden.
+ - they should be not restored when a new form is activated - the same settings should be kept.
+ - only on initial load, settings should be loaded.
+
+ */
for (int i=0; i < DesignerSubWindowCount; i++)
m_designerSubWindows[i]->activate();
@@ -143,13 +151,12 @@ void EditorWidget::activate()
// don't have their widgets yet there
resetToDefaultLayout();
m_initialized = true;
+ if (!m_globalState.isEmpty())
+ m_mainWindow->restoreSettings(m_globalState);
}
- if (!m_globalState.isEmpty())
- m_mainWindow->restoreSettings(m_globalState);
- else {
+ if (m_globalState.isEmpty())
m_globalState = m_mainWindow->saveSettings();
- }
}
void EditorWidget::hideEvent(QHideEvent *)