// make sure mode is shown
q->showMode();
+ if (q->currentTool()->needsOutputPane())
+ q->popupOutputPane();
ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance();
{
if (d->m_mode)
ModeManager::instance()->activateMode(d->m_mode->id());
+}
+
+void AnalyzerManager::popupOutputPane()
+{
d->m_outputpane->popup();
}
AnalyzerRunControl *createAnalyzer(const AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *rc = 0);
void showMode();
+ void popupOutputPane();
public slots:
void startTool();
/// @return true when this tool can be run remotely, e.g. on a meego or maemo device
virtual bool canRunRemotely() const = 0;
+
+ /// @return true when this tool needs the output pane to be show on startup
+ virtual bool needsOutputPane() const = 0;
};
} // namespace Analyzer
m_progress->setProgressRange(0, 2);
}
-CallgrindEngine::~CallgrindEngine()
-{
-}
-
QStringList CallgrindEngine::toolArguments() const
{
QStringList arguments;
class CallgrindEngine : public Valgrind::Internal::ValgrindEngine
{
Q_OBJECT
+
public:
explicit CallgrindEngine(const Analyzer::AnalyzerStartParameters &sp,
ProjectExplorer::RunConfiguration *runConfiguration);
- virtual ~CallgrindEngine();
void start();
#include <QtCore/QMap>
#include <QtCore/QString>
-using namespace Callgrind::Internal;
+namespace Callgrind {
+namespace Internal {
QColor CallgrindHelper::colorForString(const QString &text)
{
{
if (costs > 99.9f)
return locale.toString(100) + locale.percent();
- else if (costs > 9.99f)
+ if (costs > 9.99f)
return locale.toString(costs, 'f', 1) + locale.percent();
- else if (costs > 0.009f)
+ if (costs > 0.009f)
return locale.toString(costs, 'f', 2) + locale.percent();
- else
- return QString("<") + locale.toString(0.01f) + locale.percent();
+ return QString("<") + locale.toString(0.01f) + locale.percent();
}
+
+} // namespace Internal
+} // namespace Callgrind
QString toPercent(float costs, const QLocale &locale = QLocale());
}
-}
-}
+} // namespace Internal
+} // namespace Callgrind
#endif // CALLGRINDHELPER_H
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzersettings.h>
#include <analyzerbase/analyzerutils.h>
-#include <analyzerbase/ianalyzeroutputpaneadapter.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/icontext.h>
}
CallgrindTool::CallgrindTool(QObject *parent)
-: Analyzer::IAnalyzerTool(parent)
-, m_callgrindWidgetHandler(0)
-, m_dumpAction(0)
-, m_resetAction(0)
-, m_pauseAction(0)
-, m_showCostsOfFunctionAction(0)
-, m_toolbarWidget(0)
+ : Analyzer::IAnalyzerTool(parent)
+ , m_callgrindWidgetHandler(0)
+ , m_dumpAction(0)
+ , m_resetAction(0)
+ , m_pauseAction(0)
+ , m_showCostsOfFunctionAction(0)
+ , m_toolbarWidget(0)
{
Core::ICore *core = Core::ICore::instance();
{
CallgrindEngine *engine = new CallgrindEngine(sp, runConfiguration);
- connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)), SLOT(takeParserData(CallgrindEngine *)));
-
+ connect(engine, SIGNAL(parserDataReady(CallgrindEngine *)),
+ SLOT(takeParserData(CallgrindEngine *)));
connect(engine, SIGNAL(starting(const Analyzer::IAnalyzerEngine*)),
- this, SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
+ SLOT(engineStarting(const Analyzer::IAnalyzerEngine*)));
connect(engine, SIGNAL(finished()),
- this, SLOT(engineFinished()));
+ SLOT(engineFinished()));
connect(this, SIGNAL(dumpRequested()), engine, SLOT(dump()));
connect(this, SIGNAL(resetRequested()), engine, SLOT(reset()));
return widget;
}
-CallgrindWidgetHandler *CallgrindTool::callgrindWidgetHandler() const
-{
- return m_callgrindWidgetHandler;
-}
-
void CallgrindTool::clearErrorView()
{
clearTextMarks();
virtual QWidget *createControlWidget();
// For the output pane adapter.
- CallgrindWidgetHandler *callgrindWidgetHandler() const;
void clearErrorView();
virtual bool canRunRemotely() const;
+ bool needsOutputPane() const { return false; }
signals:
void dumpRequested();
// QGraphicsView::fitInView(const QRectF &rect,
// Qt::AspectRatioMode aspectRatioMode)
// Bug report here: http://bugreports.qt.nokia.com/browse/QTBUG-11945
-#define FIT_IN_VIEW_MARGIN 2;
+static const int FIT_IN_VIEW_MARGIN = 2;
using namespace Valgrind::Callgrind;
{
public:
Private(Visualisation *qq);
- ~Private();
void handleMousePressEvent(QMouseEvent *event, bool doubleClicked);
qreal sceneHeight() const;
qq, SLOT(populateScene()));
}
-Visualisation::Private::~Private()
-{
-
-}
-
void Visualisation::Private::handleMousePressEvent(QMouseEvent *event,
bool doubleClicked)
{
QGraphicsView::resizeEvent(event);
}
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Callgrind
Private *d;
};
-} // Internal
-} // Callgrind
+} // namespace Internal
+} // namespace Callgrind
#endif // VALGRIND_CALLGRIND_CALLGRINDVISUALISATION_H
return DebugMode;
}
-class FrameFinder : public ErrorListModel::RelevantFrameFinder {
+class FrameFinder : public ErrorListModel::RelevantFrameFinder
+{
public:
- Frame findRelevant(const Error &error) const {
+ Frame findRelevant(const Error &error) const
+ {
const QVector<Stack> stacks = error.stacks();
if (stacks.isEmpty())
return Frame();
QMenu *MemcheckTool::filterMenu() const
{
- QTC_ASSERT(m_suppressionSeparator, return 0; )
+ QTC_ASSERT(m_suppressionSeparator, return 0);
foreach (QWidget *w, m_suppressionSeparator->associatedWidgets())
if (QMenu *menu = qobject_cast<QMenu *>(w))
return menu;
void MemcheckTool::internalParserError(const QString &errorString)
{
- QMessageBox::critical(m_errorView, tr("Internal Error"), tr("Error occurred parsing valgrind output: %1").arg(errorString));
+ QMessageBox::critical(m_errorView, tr("Internal Error"),
+ tr("Error occurred parsing valgrind output: %1").arg(errorString));
}
void MemcheckTool::clearErrorView()
namespace Memcheck {
namespace Internal {
+
class MemCheckOutputPaneAdapter;
class MemcheckErrorView;
class FrameFinder;
class MemcheckErrorFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
+
public:
MemcheckErrorFilterProxyModel(QObject *parent = 0);
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
+
private:
QList<int> m_acceptedKinds;
bool m_filterExternalIssues;
class MemcheckTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
+
public:
explicit MemcheckTool(QObject *parent = 0);
ToolMode mode() const;
void initialize();
- virtual void extensionsInitialized() {}
+ void extensionsInitialized() {}
- virtual Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter();
- virtual Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
- ProjectExplorer::RunConfiguration *runConfiguration = 0);
+ Analyzer::IAnalyzerOutputPaneAdapter *outputPaneAdapter();
+ Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
+ ProjectExplorer::RunConfiguration *runConfiguration = 0);
// For the output pane adapter.
MemcheckErrorView *ensurePaneErrorView();
QWidget *createPaneToolBarWidget();
void clearErrorView();
- virtual bool canRunRemotely() const;
+ bool canRunRemotely() const;
+ bool needsOutputPane() const { return true; }
private slots:
void settingsDestroyed(QObject *settings);
#include "qmlprofilerplugin.h"
#include "qmlprofilerconstants.h"
#include "qmlprofilerattachdialog.h"
+#include "qmlprofilersummaryview.h"
#include "tracewindow.h"
+#include "timelineview.h"
+
#include <qmljsdebugclient/qdeclarativedebugclient_p.h>
#include <analyzerbase/analyzermanager.h>
#include <analyzerbase/analyzerconstants.h>
#include <analyzerbase/ianalyzeroutputpaneadapter.h>
-#include "timelineview.h"
-
#include "canvas/qdeclarativecanvas_p.h"
#include "canvas/qdeclarativecontext2d_p.h"
#include "canvas/qdeclarativetiledcanvas_p.h"
#include <QtGui/QHBoxLayout>
#include <QtGui/QLabel>
-#include <QtGui/QToolButton>
-
#include <QtGui/QTabWidget>
-#include "qmlprofilersummaryview.h"
+#include <QtGui/QToolButton>
using namespace Analyzer;
using namespace QmlProfiler::Internal;
virtual void goToNext() { /*TODO*/ }
virtual void goToPrev() { /*TODO*/ }
-
private:
QmlProfilerTool *m_tool;
};
connectClient();
AnalyzerManager::instance()->showMode();
+ AnalyzerManager::instance()->popupOutputPane();
} else {
stopRecording();
}
class QmlProfilerTool : public Analyzer::IAnalyzerTool
{
Q_OBJECT
+
public:
explicit QmlProfilerTool(QObject *parent = 0);
~QmlProfilerTool();
QWidget *createTimeLineWidget();
bool canRunRemotely() const;
+ bool needsOutputPane() const { return false; }
void clearDisplay();
///FIXME: get a better API for this into Qt Creator
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
- QList< Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
+ QList<Core::IOutputPane *> panes = pm->getObjects<Core::IOutputPane>();
foreach (Core::IOutputPane *pane, panes) {
if (pane->displayName() == tr("Application Output")) {
pane->popup(false);