2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2011-03-11 12:22:57 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** 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, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2011-03-25 09:25:17 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02: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
|
|
|
|
2013-09-16 14:33:07 +02:00
|
|
|
#include <QQuickView>
|
|
|
|
|
#include <QWidget>
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2014-02-11 21:55:42 +02:00
|
|
|
namespace Analyzer { class IAnalyzerTool; }
|
2012-02-24 10:47:17 +01:00
|
|
|
|
2011-03-25 09:21:00 +01:00
|
|
|
namespace QmlProfiler {
|
2013-08-08 13:28:08 +02:00
|
|
|
|
|
|
|
|
class QmlProfilerModelManager;
|
2011-03-25 09:21:00 +01:00
|
|
|
namespace Internal {
|
|
|
|
|
|
2012-02-24 10:47:17 +01:00
|
|
|
class QmlProfilerStateManager;
|
|
|
|
|
class QmlProfilerViewManager;
|
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
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:
|
2013-08-08 13:28:08 +02:00
|
|
|
explicit QmlProfilerTraceView(QWidget *parent, Analyzer::IAnalyzerTool *profilerTool, QmlProfilerViewManager *container, QmlProfilerModelManager *modelManager, QmlProfilerStateManager *profilerState);
|
2012-02-24 10:47:17 +01:00
|
|
|
~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;
|
2014-02-21 18:34:05 +01:00
|
|
|
void showContextMenu(QPoint position);
|
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();
|
2013-08-08 13:28:08 +02:00
|
|
|
void selectNextEventByHash(const QString &eventHash);
|
|
|
|
|
void selectNextEventByLocation(const QString &filename, const int line, const int column);
|
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 updateRange();
|
2011-03-11 12:22:57 +01:00
|
|
|
|
2012-01-13 12:25:53 +01:00
|
|
|
void updateToolTip(const QString &text);
|
2012-02-24 10:47:17 +01:00
|
|
|
void profilerDataModelStateChanged();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
virtual void resizeEvent(QResizeEvent *event);
|
2014-02-21 18:34:05 +01:00
|
|
|
virtual void contextMenuEvent(QContextMenuEvent *event);
|
2012-02-24 10:47:17 +01:00
|
|
|
|
|
|
|
|
private slots:
|
2013-11-28 14:42:03 +01:00
|
|
|
void setZoomSliderEnabled(bool enabled);
|
|
|
|
|
void setZoomSliderVisible(bool visible);
|
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);
|
2013-11-12 12:44:54 +01:00
|
|
|
void showZoomSlider(bool);
|
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:
|
2011-10-11 17:52:39 +02:00
|
|
|
QWidget *createToolbar();
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
|
2014-02-21 18:34:05 +01:00
|
|
|
class QmlProfilerQuickView : public QQuickView {
|
|
|
|
|
public:
|
|
|
|
|
QmlProfilerQuickView(QmlProfilerTraceView *parent) : parent(parent) {}
|
|
|
|
|
protected:
|
|
|
|
|
QmlProfilerTraceView *parent;
|
|
|
|
|
bool event(QEvent *ev);
|
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|