analyzer: merge dockwidget and toolbar creation.

Now that dock and control widgets are always created as late as
possible and both are needed immediately afterward it makes sense
to merge there construction. This also reduces the chance to create
a partial tool gui in an inconsitent state.

Change-Id: Ic7f405d65b2b8f0b4ee3ff0ef991d6e4746bac0a
Reviewed-on: http://codereview.qt.nokia.com/1249
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-07-06 16:52:14 +02:00
committed by hjk
parent 4823487b59
commit 868613b5ed
8 changed files with 91 additions and 116 deletions

View File

@@ -225,15 +225,23 @@ IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp
return engine;
}
void QmlProfilerTool::initializeDockWidgets()
void QmlProfilerTool::toolSelected()
{
ensureWidgets();
updateAttachAction(true);
}
void QmlProfilerTool::ensureWidgets()
void QmlProfilerTool::toolDeselected()
{
if (d->m_traceWindow)
return;
updateAttachAction(false);
}
QWidget *QmlProfilerTool::createWidgets()
{
QTC_ASSERT(!d->m_traceWindow, return 0);
//
// DockWidgets
//
Utils::FancyMainWindow *mw = AnalyzerManager::mainWindow();
@@ -291,23 +299,10 @@ void QmlProfilerTool::ensureWidgets()
mw->tabifyDockWidget(eventsDock, timelineDock);
mw->tabifyDockWidget(timelineDock, calleeDock);
mw->tabifyDockWidget(calleeDock, callerDock);
}
void QmlProfilerTool::toolSelected()
{
updateAttachAction(true);
}
void QmlProfilerTool::toolDeselected()
{
updateAttachAction(false);
}
QWidget *QmlProfilerTool::createControlWidget()
{
ensureWidgets();
// custom toolbar (TODO)
//
// Toolbar
//
QWidget *toolbarWidget = new QWidget;
toolbarWidget->setObjectName(QLatin1String("QmlProfilerToolBarWidget"));