2011-03-11 12:22:57 +01:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
2012-01-26 18:33:46 +01:00
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** 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.
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
2011-03-25 09:25:17 +01:00
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
2011-07-06 15:48:52 +00:00
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
2011-03-25 09:25:17 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2011-07-06 15:48:52 +00:00
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
2011-03-25 09:25:17 +01:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
#ifndef QMLPROFILERTRACEVIEW_H
|
|
|
|
|
#define QMLPROFILERTRACEVIEW_H
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDeclarativeView>
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
namespace Analyzer {
|
|
|
|
|
class IAnalyzerTool;
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
namespace QmlProfiler {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
class QmlProfilerStateManager;
|
|
|
|
|
class QmlProfilerViewManager;
|
|
|
|
|
class QmlProfilerDataModel;
|
|
|
|
|
|
|
|
|
|
// capture mouse wheel events
|
2011-10-20 17:38:24 +02:00
|
|
|
class MouseWheelResizer : public QObject {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
MouseWheelResizer(QObject *parent=0):QObject(parent){}
|
|
|
|
|
protected:
|
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
signals:
|
|
|
|
|
void mouseWheelMoved(int x, int y, int delta);
|
|
|
|
|
};
|
|
|
|
|
|
2011-10-11 17:52:39 +02:00
|
|
|
// centralized zoom control
|
|
|
|
|
class ZoomControl : public QObject {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
ZoomControl(QObject *parent=0):QObject(parent),m_startTime(0),m_endTime(0) {}
|
|
|
|
|
~ZoomControl(){}
|
|
|
|
|
|
2011-10-20 17:38:24 +02:00
|
|
|
Q_INVOKABLE void setRange(qint64 startTime, qint64 endTime);
|
2011-10-11 17:52:39 +02:00
|
|
|
Q_INVOKABLE qint64 startTime() { return m_startTime; }
|
|
|
|
|
Q_INVOKABLE qint64 endTime() { return m_endTime; }
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void rangeChanged();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
qint64 m_startTime;
|
|
|
|
|
qint64 m_endTime;
|
|
|
|
|
};
|
|
|
|
|
|
2011-11-16 16:08:05 +01:00
|
|
|
class ScrollableDeclarativeView : public QDeclarativeView
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
explicit ScrollableDeclarativeView(QWidget *parent = 0);
|
|
|
|
|
~ScrollableDeclarativeView();
|
|
|
|
|
protected:
|
|
|
|
|
void scrollContentsBy(int dx, int dy);
|
|
|
|
|
};
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
class QmlProfilerTraceView : public QWidget
|
2011-03-11 12:22:57 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2011-05-18 17:05:49 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
public:
|
2012-02-24 10:47:17 +01:00
|
|
|
explicit QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerDataModel *model, QmlProfilerStateManager *profilerState);
|
|
|
|
|
~QmlProfilerTraceView();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
void reset();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2011-11-08 16:54:23 +01:00
|
|
|
bool hasValidSelection() const;
|
|
|
|
|
qint64 selectionStart() const;
|
|
|
|
|
qint64 selectionEnd() const;
|
2011-06-24 18:19:08 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
public slots:
|
2012-02-13 15:26:57 +01:00
|
|
|
void clearDisplay();
|
2012-02-24 10:47:17 +01:00
|
|
|
void selectNextEventWithId(int eventId);
|
2012-02-13 15:26:57 +01:00
|
|
|
|
|
|
|
|
private slots:
|
2011-03-11 12:22:57 +01:00
|
|
|
void updateCursorPosition();
|
2011-10-19 14:28:21 +02:00
|
|
|
void toggleRangeMode(bool);
|
|
|
|
|
void updateRangeButton();
|
2012-02-24 10:47:17 +01:00
|
|
|
void toggleLockMode(bool);
|
2011-10-26 11:32:01 +02:00
|
|
|
void updateLockButton();
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2011-10-20 17:38:24 +02:00
|
|
|
void setZoomLevel(int zoomLevel);
|
|
|
|
|
void updateRange();
|
2012-02-24 10:47:17 +01:00
|
|
|
void mouseWheelMoved(int mouseX, int mouseY, int wheelDelta);
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2012-01-13 12:25:53 +01:00
|
|
|
void updateToolTip(const QString &text);
|
2012-02-03 16:33:51 +01:00
|
|
|
void updateVerticalScroll(int newPosition);
|
2012-02-24 10:47:17 +01:00
|
|
|
void profilerDataModelStateChanged();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void profilerStateChanged();
|
|
|
|
|
void clientRecordingChanged();
|
|
|
|
|
void serverRecordingChanged();
|
2011-09-27 14:38:22 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
signals:
|
2012-01-12 16:36:40 +01:00
|
|
|
void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columNumber);
|
2012-02-24 10:47:17 +01:00
|
|
|
void selectedEventChanged(int eventId);
|
|
|
|
|
|
2011-06-24 18:19:08 +02:00
|
|
|
void jumpToPrev();
|
|
|
|
|
void jumpToNext();
|
2011-10-19 14:28:21 +02:00
|
|
|
void rangeModeChanged(bool);
|
2011-10-26 11:32:01 +02:00
|
|
|
void lockModeChanged(bool);
|
2011-07-05 15:50:32 +02:00
|
|
|
void enableToolbar(bool);
|
2011-10-20 17:38:24 +02:00
|
|
|
void zoomLevelChanged(int);
|
2011-07-26 13:56:14 +02:00
|
|
|
|
2012-05-16 12:16:45 +02:00
|
|
|
void resized();
|
|
|
|
|
|
2011-07-26 13:56:14 +02:00
|
|
|
private:
|
|
|
|
|
void contextMenuEvent(QContextMenuEvent *);
|
2011-10-11 17:52:39 +02:00
|
|
|
QWidget *createToolbar();
|
2011-10-20 17:38:24 +02:00
|
|
|
QWidget *createZoomToolbar();
|
2011-10-11 17:52:39 +02:00
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
void setRecording(bool recording);
|
|
|
|
|
void setAppKilled();
|
2011-07-26 13:56:14 +02:00
|
|
|
|
2011-03-11 12:22:57 +01:00
|
|
|
private:
|
2012-02-24 10:47:17 +01:00
|
|
|
class QmlProfilerTraceViewPrivate;
|
|
|
|
|
QmlProfilerTraceViewPrivate *d;
|
2011-03-11 12:22:57 +01:00
|
|
|
};
|
|
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace QmlProfiler
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
#endif // QMLPROFILERTRACEVIEW_H
|
2011-03-11 12:22:57 +01:00
|
|
|
|