Commit 7456fa23 authored by Marco Bubke's avatar Marco Bubke Committed by Thomas Hartmann

QmlDesigner: Refactor designmode widget

Change-Id: I5a84408333afb8e6043f76eb0b9f028d8d78e2f3
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 89efd76c
......@@ -428,30 +428,7 @@ void DesignModeWidget::setup()
setupNavigatorHistory(currentDesignDocument()->textEditor());
// right area:
QWidget *centerWidget = new QWidget;
{
QVBoxLayout *rightLayout = new QVBoxLayout(centerWidget);
rightLayout->setMargin(0);
rightLayout->setSpacing(0);
rightLayout->addWidget(m_fakeToolBar);
//### we now own these here
rightLayout->addWidget(viewManager().statesEditorWidget());
FormEditorContext *formEditorContext = new FormEditorContext(viewManager().formEditorWidget());
Core::ICore::addContextObject(formEditorContext);
NavigatorContext *navigatorContext = new NavigatorContext(viewManager().navigatorWidget());
Core::ICore::addContextObject(navigatorContext);
// editor and output panes
m_outputPlaceholderSplitter->addWidget(viewManager().formEditorWidget());
m_outputPlaceholderSplitter->addWidget(m_outputPanePlaceholder);
m_outputPlaceholderSplitter->setStretchFactor(0, 10);
m_outputPlaceholderSplitter->setStretchFactor(1, 0);
m_outputPlaceholderSplitter->setOrientation(Qt::Vertical);
rightLayout->addWidget(m_outputPlaceholderSplitter);
}
QWidget *centerWidget = createCenterWidget();
// m_mainSplitter area:
m_mainSplitter->addWidget(m_leftSideBar);
......@@ -567,6 +544,35 @@ void DesignModeWidget::addNavigatorHistoryEntry(const QString &fileName)
++m_navigatorHistoryCounter;
}
QWidget *DesignModeWidget::createCenterWidget() const
{
QWidget *centerWidget = new QWidget;
QVBoxLayout *rightLayout = new QVBoxLayout(centerWidget);
rightLayout->setMargin(0);
rightLayout->setSpacing(0);
rightLayout->addWidget(m_fakeToolBar);
//### we now own these here
rightLayout->addWidget(viewManager().statesEditorWidget());
FormEditorContext *formEditorContext = new FormEditorContext(viewManager().formEditorWidget());
Core::ICore::addContextObject(formEditorContext);
NavigatorContext *navigatorContext = new NavigatorContext(viewManager().navigatorWidget());
Core::ICore::addContextObject(navigatorContext);
// editor and output panes
m_outputPlaceholderSplitter->addWidget(viewManager().formEditorWidget());
m_outputPlaceholderSplitter->addWidget(m_outputPanePlaceholder);
m_outputPlaceholderSplitter->setStretchFactor(0, 10);
m_outputPlaceholderSplitter->setStretchFactor(1, 0);
m_outputPlaceholderSplitter->setOrientation(Qt::Vertical);
rightLayout->addWidget(m_outputPlaceholderSplitter);
return centerWidget;
}
void DesignModeWidget::showErrorMessage(const QList<RewriterView::Error> &errors)
{
Q_ASSERT(!errors.isEmpty());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment