2011-03-25 09:25:17 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
|
**
|
2011-05-06 15:05:37 +02:00
|
|
|
** Contact: Nokia Corporation (info@qt.nokia.com)
|
2011-03-25 09:25:17 +01:00
|
|
|
**
|
|
|
|
|
** No Commercial Usage
|
|
|
|
|
**
|
|
|
|
|
** This file contains pre-release code and may not be distributed.
|
|
|
|
|
** You may use this file in accordance with the terms and conditions
|
|
|
|
|
** contained in the Technology Preview License Agreement accompanying
|
|
|
|
|
** this package.
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** If you have questions regarding the use of this file, please contact
|
2011-05-06 15:05:37 +02:00
|
|
|
** Nokia at info@qt.nokia.com.
|
2011-03-25 09:25:17 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
#ifndef QMLPROFILERTOOL_H
|
|
|
|
|
#define QMLPROFILERTOOL_H
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
#include <analyzerbase/ianalyzertool.h>
|
|
|
|
|
#include <analyzerbase/ianalyzerengine.h>
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
namespace QmlProfiler {
|
2011-03-11 12:22:57 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
class QmlProfilerTool : public Analyzer::IAnalyzerTool
|
2011-03-11 12:22:57 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-05-20 09:12:34 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
public:
|
2011-06-30 18:55:48 +02:00
|
|
|
explicit QmlProfilerTool(QObject *parent);
|
2011-03-11 12:22:57 +01:00
|
|
|
~QmlProfilerTool();
|
|
|
|
|
|
2011-06-30 13:44:22 +02:00
|
|
|
QByteArray id() const;
|
2011-03-11 12:22:57 +01:00
|
|
|
QString displayName() const;
|
2011-06-28 19:14:08 +02:00
|
|
|
QString description() const;
|
2011-03-11 12:22:57 +01:00
|
|
|
ToolMode mode() const;
|
|
|
|
|
|
2011-06-30 13:44:22 +02:00
|
|
|
void extensionsInitialized() {}
|
2011-05-20 12:43:29 +02:00
|
|
|
void initializeDockWidgets();
|
2011-06-29 16:04:03 +02:00
|
|
|
void toolSelected();
|
|
|
|
|
void toolDeselected();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-04-04 14:39:28 +02:00
|
|
|
Analyzer::IAnalyzerEngine *createEngine(const Analyzer::AnalyzerStartParameters &sp,
|
2011-06-28 19:14:08 +02:00
|
|
|
ProjectExplorer::RunConfiguration *runConfiguration = 0);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-05-20 12:43:29 +02:00
|
|
|
QWidget *createControlWidget();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
|
|
|
|
public slots:
|
2011-06-27 17:18:55 +02:00
|
|
|
void connectClient(int port);
|
2011-03-11 12:22:57 +01:00
|
|
|
void disconnectClient();
|
|
|
|
|
|
2011-04-06 12:26:19 +02:00
|
|
|
void startRecording();
|
2011-03-11 12:22:57 +01:00
|
|
|
void stopRecording();
|
2011-04-06 12:26:19 +02:00
|
|
|
void setRecording(bool recording);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-04-01 13:57:49 +02:00
|
|
|
void gotoSourceLocation(const QString &fileUrl, int lineNumber);
|
2011-03-24 12:42:15 +01:00
|
|
|
void updateTimer(qreal elapsedSeconds);
|
|
|
|
|
|
2011-06-24 18:19:08 +02:00
|
|
|
void clearDisplay();
|
|
|
|
|
|
2011-03-24 12:42:15 +01:00
|
|
|
signals:
|
|
|
|
|
void setTimeLabel(const QString &);
|
2011-04-06 12:26:19 +02:00
|
|
|
void fetchingData(bool);
|
2011-04-14 15:23:17 +02:00
|
|
|
void connectionFailed();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-04-01 13:48:10 +02:00
|
|
|
private slots:
|
|
|
|
|
void updateProjectFileList();
|
2011-04-04 15:03:31 +02:00
|
|
|
void attach();
|
2011-04-12 17:24:56 +02:00
|
|
|
void tryToConnect();
|
2011-04-14 17:19:28 +02:00
|
|
|
void connectionStateChanged();
|
2011-04-01 13:48:10 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
private:
|
2011-06-29 16:04:03 +02:00
|
|
|
void updateAttachAction(bool isCurrentTool);
|
2011-04-12 17:24:56 +02:00
|
|
|
void connectToClient();
|
2011-04-15 14:51:49 +02:00
|
|
|
void updateRecordingState();
|
2011-04-12 17:24:56 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
class QmlProfilerToolPrivate;
|
|
|
|
|
QmlProfilerToolPrivate *d;
|
|
|
|
|
};
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|
2011-03-11 12:22:57 +01:00
|
|
|
|
|
|
|
|
#endif // QMLPROFILERTOOL_H
|