diff gui/src/editor/FileEditor.cpp @ 14681:66ff321cb62e gui

Integrated the editor to be docked with the other widgets. * FilesDockWidget: Some code style corrections. * MainWindow: Added a checkable menu entry for the editor and added file editor as dockable widget. * FileEditor: Moved setting the object name to the interface. * FileEditorInterface: Added routines to correctly handle closing and opening the dock widget.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Thu, 24 May 2012 13:20:27 +0200
parents 628eeaf879f7
children ca733a66be7a
line wrap: on
line diff
--- a/gui/src/editor/FileEditor.cpp
+++ b/gui/src/editor/FileEditor.cpp
@@ -253,12 +253,13 @@
 void
 FileEditor::construct ()
 {
+  QWidget *widget = new QWidget (this);
   QSettings *settings = ResourceManager::instance ()->settings ();
   QStyle *style = QApplication::style ();
 
-  m_menuBar = new QMenuBar (this);
-  m_toolBar = new QToolBar (this);
-  m_tabWidget = new QTabWidget (this);
+  m_menuBar = new QMenuBar (widget);
+  m_toolBar = new QToolBar (widget);
+  m_tabWidget = new QTabWidget (widget);
   m_tabWidget->setTabsClosable (true);
   //m_longTitle = settings->value ("editor/longWindowTitle",true).toBool ();
 
@@ -287,8 +288,8 @@
         QIcon::fromTheme("edit-redo",style->standardIcon (QStyle::SP_ArrowRight)),
         tr("&Redo"), m_toolBar);
 
-  m_copyAction = new QAction (QIcon::fromTheme("edit-copy"), tr("&Copy"),m_toolBar);
-  m_cutAction = new QAction (QIcon::fromTheme("edit-cut"), tr("Cu&t"),m_toolBar);
+  m_copyAction = new QAction (QIcon::fromTheme ("edit-copy"), tr ("&Copy"), m_toolBar);
+  m_cutAction = new QAction (QIcon::fromTheme ("edit-cut"), tr ("Cu&t"), m_toolBar);
 
   QAction *pasteAction              = new QAction (QIcon::fromTheme ("edit-paste"), tr ("&Paste"),m_toolBar);
   QAction *nextBookmarkAction       = new QAction (tr ("&Next Bookmark"),m_toolBar);
@@ -372,7 +373,8 @@
   layout->addWidget (m_toolBar);
   layout->addWidget (m_tabWidget);
   layout->setMargin (0);
-  setLayout (layout);
+  widget->setLayout (layout);
+  setWidget (widget);
 
   connect (newAction,               SIGNAL (triggered ()), this, SLOT (requestNewFile ()));
   connect (openAction,              SIGNAL (triggered ()), this, SLOT (requestOpenFile ()));