From 84f9c2b6e31c46d7d692224c36bd42bcd969a5f2 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 19 Feb 2012 21:39:11 +0000 Subject: Added a splitter to the editorwindow. --- src/editorwindow.cc | 13 +++++++++++-- src/editorwindow.h | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/editorwindow.cc b/src/editorwindow.cc index f01548d..65a84e6 100644 --- a/src/editorwindow.cc +++ b/src/editorwindow.cc @@ -13,6 +13,7 @@ #include #include + #include #include #include @@ -21,8 +22,13 @@ namespace editor EditorWindow::EditorWindow(QWidget *parent) : QWidget(parent) { - editorwindow_mapwidget = new MapWidget(this); - editorwindow_sidebar = new SideBar(this); + editorwindow_splitter = new QSplitter(this); + + editorwindow_mapwidget = new MapWidget(); + editorwindow_sidebar = new SideBar(); + + editorwindow_splitter->addWidget(editorwindow_sidebar); + editorwindow_splitter->addWidget(editorwindow_mapwidget); connect(editorwindow_mapwidget, SIGNAL(propertiesChanged(EntityProperties *)), editorwindow_sidebar, SLOT(setProperties(EntityProperties *))); connect(editorwindow_sidebar, SIGNAL(entityChanged()), editorwindow_mapwidget, SLOT(resizeChildren())); @@ -30,11 +36,14 @@ EditorWindow::EditorWindow(QWidget *parent) : QWidget(parent) void EditorWindow::resizeEvent (QResizeEvent *event) { + /* editorwindow_sidebar->resize(256, height()); editorwindow_mapwidget->setGeometry( editorwindow_sidebar->width(), 0, width() - editorwindow_sidebar->width(), height() ); + */ + editorwindow_splitter->resize(width(), height()); } bool EditorWindow::loadFile(const QString &filename) diff --git a/src/editorwindow.h b/src/editorwindow.h index dc1ed6e..4305aea 100644 --- a/src/editorwindow.h +++ b/src/editorwindow.h @@ -10,6 +10,8 @@ #include +class QSplitter; + namespace editor { @@ -36,6 +38,7 @@ protected: private: MapWidget *editorwindow_mapwidget; SideBar *editorwindow_sidebar; + QSplitter *editorwindow_splitter; }; } -- cgit v1.2.3