From ae2da9a350ee568b80cff93a74e1409ac833f444 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 17 Jul 2014 17:31:57 +0200 Subject: [PATCH] EditorManager: Add window actions (fullscreen etc) to editor windows Change-Id: I478db8c994cc3126d8d518e3d574e9adfa600ad1 Reviewed-by: Daniel Teske --- .../editormanager/editormanager.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index b9a13dd56dc..a296ef16de3 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -686,9 +686,18 @@ void EditorManager::splitNewWindow(Internal::EditorView *view) else newEditor = editor; // move to the new view splitter = new SplitterOrView; - splitter->setAttribute(Qt::WA_DeleteOnClose); - splitter->setAttribute(Qt::WA_QuitOnClose, false); // don't prevent Qt Creator from closing - splitter->resize(QSize(800, 600)); + QWidget *win = new QWidget; + QVBoxLayout *layout = new QVBoxLayout; + layout->setMargin(0); + layout->setSpacing(0); + win->setLayout(layout); + layout->addWidget(splitter); + win->setFocusProxy(splitter); + win->setAttribute(Qt::WA_DeleteOnClose); + win->setAttribute(Qt::WA_QuitOnClose, false); // don't prevent Qt Creator from closing + win->resize(QSize(800, 600)); + static int windowId = 0; + ICore::registerWindow(win, Context(Id("EditorManager.ExternalWindow.").withSuffix(++windowId))); IContext *context = new IContext; context->setContext(Context(Constants::C_EDITORMANAGER)); context->setWidget(splitter); @@ -696,8 +705,8 @@ void EditorManager::splitNewWindow(Internal::EditorView *view) d->m_root.append(splitter); d->m_rootContext.append(context); connect(splitter, SIGNAL(destroyed(QObject*)), m_instance, SLOT(rootDestroyed(QObject*))); - splitter->show(); - ICore::raiseWindow(splitter); + win->show(); + ICore::raiseWindow(win); if (newEditor) m_instance->activateEditor(splitter->view(), newEditor, IgnoreNavigationHistory); else