forked from qt-creator/qt-creator
analyzer: more verbosity in the tool description
Change-Id: Ie259c78710c9e926f75595a7c22195efb7036532 Reviewed-on: http://codereview.qt.nokia.com/856 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -62,19 +62,23 @@ class IAnalyzerEngine;
|
||||
class ANALYZER_EXPORT IAnalyzerTool : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit IAnalyzerTool(QObject *parent = 0);
|
||||
|
||||
/// @return unique ID for this tool
|
||||
/// Returns a unique ID for this tool.
|
||||
virtual QString id() const = 0;
|
||||
/// @return user readable display name for this tool
|
||||
/// Returns a short user readable display name for this tool.
|
||||
virtual QString displayName() const = 0;
|
||||
/// Returns a user readable description name for this tool.
|
||||
virtual QString description() const = 0;
|
||||
|
||||
/**
|
||||
* The mode in which this tool should preferably be run
|
||||
*
|
||||
* memcheck, for example, requires debug symbols, hence DebugMode is preferred.
|
||||
* otoh callgrind should look at optimized code, hence ReleaseMode.
|
||||
* The memcheckt tool, for example, requires debug symbols, hence DebugMode
|
||||
* is preferred. On the other hand, callgrind should look at optimized code,
|
||||
* hence ReleaseMode.
|
||||
*/
|
||||
enum ToolMode {
|
||||
DebugMode,
|
||||
@@ -86,28 +90,29 @@ public:
|
||||
static QString modeString(ToolMode mode);
|
||||
|
||||
/**
|
||||
* The implementation should setup widgets for the output pane here and optionally add
|
||||
* dock widgets in the analyzation mode if wanted.
|
||||
* The implementation should setup widgets for the output pane here and
|
||||
* optionally add dock widgets in the analyzation mode if wanted.
|
||||
*/
|
||||
virtual void initialize() = 0;
|
||||
/// gets called after all analyzation tools where initialized.
|
||||
/// This gets called after all analyzation tools where initialized.
|
||||
virtual void extensionsInitialized() = 0;
|
||||
|
||||
/**
|
||||
* Called to add all dock widgets if tool becomes active first time.
|
||||
* This is called to add all dock widgets if tool becomes active first time.
|
||||
* \sa AnalzyerManager::createDockWidget
|
||||
*/
|
||||
virtual void initializeDockWidgets();
|
||||
|
||||
/// subclass to return a control widget which will be shown
|
||||
/// in the output pane when this tool is selected
|
||||
/// Returns a control widget which will be shown
|
||||
/// in the output pane when this tool is selected.
|
||||
virtual QWidget *createControlWidget();
|
||||
|
||||
/// @return a new engine for the given start parameters. Called each time the tool is launched.
|
||||
/// Returns a new engine for the given start parameters.
|
||||
/// Called each time the tool is launched.
|
||||
virtual IAnalyzerEngine *createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0) = 0;
|
||||
|
||||
/// @return true when this tool can be run remotely, e.g. on a meego or maemo device
|
||||
/// Returns true when this tool can be run on a remote machine.
|
||||
virtual bool canRunRemotely() const = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -150,27 +150,33 @@ QString QmlProfilerTool::displayName() const
|
||||
return tr("QML Profiler");
|
||||
}
|
||||
|
||||
QString QmlProfilerTool::description() const
|
||||
{
|
||||
return tr("The QML Profiler can be used to find performance bottlenecks in "
|
||||
"applications using QML.");
|
||||
}
|
||||
|
||||
IAnalyzerTool::ToolMode QmlProfilerTool::mode() const
|
||||
{
|
||||
return AnyMode;
|
||||
}
|
||||
|
||||
IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
ProjectExplorer::RunConfiguration *runConfiguration)
|
||||
{
|
||||
QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration);
|
||||
|
||||
// Check minimum Qt Version. We cannot really be sure what the Qt version at runtime is,
|
||||
// but guess that the active build configuraiton has been used.
|
||||
QtSupport::QtVersionNumber minimumVersion(4,7,4);
|
||||
// Check minimum Qt Version. We cannot really be sure what the Qt version
|
||||
// at runtime is, but guess that the active build configuraiton has been used.
|
||||
QtSupport::QtVersionNumber minimumVersion(4, 7, 4);
|
||||
if (Qt4ProjectManager::Qt4BuildConfiguration *qt4Config
|
||||
= qobject_cast<Qt4ProjectManager::Qt4BuildConfiguration*>(
|
||||
runConfiguration->target()->activeBuildConfiguration())) {
|
||||
if (qt4Config->qtVersion()->isValid() && qt4Config->qtVersion()->qtVersion() < minimumVersion) {
|
||||
int result = QMessageBox::warning(QApplication::activeWindow(), tr("QML Profiler"),
|
||||
"The QML profiler requires Qt 4.7.4 or newer.\n"
|
||||
"The Qt version configured in your active build configuration is too old.\n"
|
||||
"Do you want to continue?", QMessageBox::Yes, QMessageBox::No);
|
||||
"The QML profiler requires Qt 4.7.4 or newer.\n"
|
||||
"The Qt version configured in your active build configuration is too old.\n"
|
||||
"Do you want to continue?", QMessageBox::Yes, QMessageBox::No);
|
||||
if (result == QMessageBox::No)
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
|
||||
QString id() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
|
||||
void initialize();
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
void initializeDockWidgets();
|
||||
|
||||
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
||||
|
||||
QWidget *createControlWidget();
|
||||
|
||||
|
||||
@@ -521,7 +521,13 @@ QString CallgrindTool::id() const
|
||||
|
||||
QString CallgrindTool::displayName() const
|
||||
{
|
||||
return tr("Profile");
|
||||
return tr("Valgrind Function Profile");
|
||||
}
|
||||
|
||||
QString CallgrindTool::description() const
|
||||
{
|
||||
return tr("Valgrind Profile uses the \"callgrind\" tool to "
|
||||
"record function calls when a program runs.");
|
||||
}
|
||||
|
||||
IAnalyzerTool::ToolMode CallgrindTool::mode() const
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
|
||||
QString id() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
|
||||
void initialize();
|
||||
|
||||
@@ -195,12 +195,14 @@ MemcheckTool::MemcheckTool(QObject *parent)
|
||||
setObjectName(QLatin1String("MemcheckTool"));
|
||||
|
||||
m_filterProjectAction = new QAction(tr("External Errors"), this);
|
||||
m_filterProjectAction->setToolTip(tr("Show issues originating outside currently opened projects."));
|
||||
m_filterProjectAction->setToolTip(
|
||||
tr("Show issues originating outside currently opened projects."));
|
||||
m_filterProjectAction->setCheckable(true);
|
||||
|
||||
m_suppressionSeparator = new QAction(tr("Suppressions"), this);
|
||||
m_suppressionSeparator->setSeparator(true);
|
||||
m_suppressionSeparator->setToolTip(tr("These suppression files were used in the last memory analyzer run."));
|
||||
m_suppressionSeparator->setToolTip(
|
||||
tr("These suppression files were used in the last memory analyzer run."));
|
||||
|
||||
QAction *a = new QAction(tr("Definite Memory Leaks"), this);
|
||||
initKindFilterAction(a, QList<int>() << Leak_DefinitelyLost << Leak_IndirectlyLost);
|
||||
@@ -297,7 +299,13 @@ QString MemcheckTool::id() const
|
||||
|
||||
QString MemcheckTool::displayName() const
|
||||
{
|
||||
return tr("Analyze Memory");
|
||||
return tr("Valgrind Analyze Memory");
|
||||
}
|
||||
|
||||
QString MemcheckTool::description() const
|
||||
{
|
||||
return tr("Valgrind Analyze Memory uses the \"memcheck\" tool to find "
|
||||
"memory leaks");
|
||||
}
|
||||
|
||||
IAnalyzerTool::ToolMode MemcheckTool::mode() const
|
||||
|
||||
@@ -95,6 +95,7 @@ public:
|
||||
|
||||
QString id() const;
|
||||
QString displayName() const;
|
||||
QString description() const;
|
||||
ToolMode mode() const;
|
||||
|
||||
private slots:
|
||||
|
||||
Reference in New Issue
Block a user