forked from qt-creator/qt-creator
QmlProfiler: Remove slots declarations and Qt4 connections
The signals from QML are relayed through the respective models, so that we don't have to use Qt4 connections there. Change-Id: I864b49061c1f28acbebfc7378bfe39f96d3cae18 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -85,10 +85,9 @@ signals:
|
||||
void depthChanged(int depth);
|
||||
void maximumDepthChanged();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void rebuild();
|
||||
|
||||
private:
|
||||
QQmlComponent *m_delegate = nullptr;
|
||||
QAbstractItemModel *m_model = nullptr;
|
||||
int m_sizeRole = 0;
|
||||
|
@@ -50,7 +50,7 @@ public:
|
||||
QByteArray read();
|
||||
bool waitForReadyRead(int msecs = 3000);
|
||||
|
||||
Q_SIGNALS:
|
||||
signals:
|
||||
void readyRead();
|
||||
void invalidPacket();
|
||||
|
||||
|
@@ -36,7 +36,6 @@ Rectangle {
|
||||
|
||||
property bool lockItemSelection : false
|
||||
|
||||
signal updateCursorPosition
|
||||
property string fileName: ""
|
||||
property int lineNumber: -1
|
||||
property int columnNumber: 0
|
||||
@@ -242,7 +241,7 @@ Rectangle {
|
||||
var newTypeId = model.typeId(selectedItem);
|
||||
if (newTypeId !== typeId) {
|
||||
typeId = newTypeId;
|
||||
root.updateCursorPosition();
|
||||
timelineModelAggregator.updateCursorPosition();
|
||||
}
|
||||
} else {
|
||||
selectedModel = -1;
|
||||
|
@@ -61,6 +61,7 @@ public:
|
||||
signals:
|
||||
void modelsChanged();
|
||||
void heightChanged();
|
||||
void updateCursorPosition();
|
||||
|
||||
private:
|
||||
class TimelineModelAggregatorPrivate;
|
||||
|
@@ -87,7 +87,6 @@ public:
|
||||
QHash<int, QByteArray> roleNames() const override;
|
||||
QmlProfilerModelManager *modelManager() const;
|
||||
|
||||
public slots:
|
||||
void loadEvent(const QmlEvent &event, const QmlEventType &type);
|
||||
void finalize();
|
||||
void onModelManagerStateChanged();
|
||||
@@ -95,6 +94,10 @@ public slots:
|
||||
void loadNotes(int typeId, bool emitSignal);
|
||||
void clear();
|
||||
|
||||
signals:
|
||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||
void typeSelected(int typeIndex);
|
||||
|
||||
private:
|
||||
QVariant lookup(const FlameGraphData &data, int role) const;
|
||||
FlameGraphData *pushChild(FlameGraphData *parent, const QmlEvent &data);
|
||||
|
@@ -67,10 +67,9 @@ FlameGraphView::FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent
|
||||
layout->addWidget(m_content);
|
||||
setLayout(layout);
|
||||
|
||||
connect(m_content->rootObject(), SIGNAL(typeSelected(int)),
|
||||
this, SIGNAL(typeSelected(int)));
|
||||
connect(m_content->rootObject(), SIGNAL(gotoSourceLocation(QString,int,int)),
|
||||
this, SIGNAL(gotoSourceLocation(QString,int,int)));
|
||||
connect(m_model, &FlameGraphModel::typeSelected, this, &FlameGraphView::typeSelected);
|
||||
connect(m_model, &FlameGraphModel::gotoSourceLocation,
|
||||
this, &FlameGraphView::gotoSourceLocation);
|
||||
}
|
||||
|
||||
void FlameGraphView::selectByTypeId(int typeIndex)
|
||||
|
@@ -40,7 +40,6 @@ class FlameGraphView : public QmlProfilerEventsView
|
||||
public:
|
||||
FlameGraphView(QmlProfilerModelManager *manager, QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void selectByTypeId(int typeIndex) override;
|
||||
void onVisibleFeaturesChanged(quint64 features) override;
|
||||
|
||||
|
@@ -32,8 +32,6 @@ import "../flamegraph/"
|
||||
|
||||
ScrollView {
|
||||
id: root
|
||||
signal typeSelected(int typeIndex)
|
||||
signal gotoSourceLocation(string filename, int line, int column)
|
||||
|
||||
property int selectedTypeId: -1
|
||||
property int sizeRole: QmlProfilerFlameGraphModel.DurationRole
|
||||
@@ -157,9 +155,9 @@ ScrollView {
|
||||
onClicked: {
|
||||
if (flamegraphItem.FlameGraph.dataValid) {
|
||||
tooltip.selectedNode = flamegraphItem;
|
||||
root.typeSelected(flamegraphItem.FlameGraph.data(
|
||||
flameGraphModel.typeSelected(flamegraphItem.FlameGraph.data(
|
||||
QmlProfilerFlameGraphModel.TypeIdRole));
|
||||
root.gotoSourceLocation(
|
||||
flameGraphModel.gotoSourceLocation(
|
||||
flamegraphItem.FlameGraph.data(
|
||||
QmlProfilerFlameGraphModel.FilenameRole),
|
||||
flamegraphItem.FlameGraph.data(
|
||||
@@ -269,7 +267,7 @@ ScrollView {
|
||||
onClearSelection: {
|
||||
selectedTypeId = -1;
|
||||
selectedNode = null;
|
||||
root.typeSelected(-1);
|
||||
flameGraphModel.typeSelected(-1);
|
||||
}
|
||||
|
||||
dialogTitle: {
|
||||
|
@@ -44,10 +44,9 @@ public:
|
||||
explicit QmlProfilerConfigWidget(QmlProfilerSettings *settings, QWidget *parent = 0);
|
||||
~QmlProfilerConfigWidget();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void updateUi();
|
||||
|
||||
private:
|
||||
Ui::QmlProfilerConfigWidget *m_ui;
|
||||
QmlProfilerSettings *m_settings;
|
||||
};
|
||||
|
@@ -40,14 +40,13 @@ public:
|
||||
QmlProfilerEventsView(QWidget *parent = 0) : QWidget(parent) {}
|
||||
virtual void clear() {}
|
||||
|
||||
virtual void selectByTypeId(int typeIndex) = 0;
|
||||
virtual void onVisibleFeaturesChanged(quint64 features) = 0;
|
||||
|
||||
signals:
|
||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||
void typeSelected(int typeIndex);
|
||||
void showFullRange();
|
||||
|
||||
public slots:
|
||||
virtual void selectByTypeId(int typeIndex) = 0;
|
||||
virtual void onVisibleFeaturesChanged(quint64 features) = 0;
|
||||
};
|
||||
|
||||
} // namespace QmlProfiler
|
||||
|
@@ -56,7 +56,6 @@ public:
|
||||
qint64 duration() const;
|
||||
bool isRestrictedToRange() const;
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
|
||||
void setTime(qint64 startTime, qint64 endTime);
|
||||
@@ -135,6 +134,15 @@ public:
|
||||
|
||||
static const char *featureName(ProfileFeature feature);
|
||||
|
||||
void clear();
|
||||
void restrictToRange(qint64 startTime, qint64 endTime);
|
||||
bool isRestrictedToRange() const;
|
||||
|
||||
void startAcquiring();
|
||||
|
||||
void save(const QString &filename);
|
||||
void load(const QString &filename);
|
||||
|
||||
signals:
|
||||
void error(const QString &error);
|
||||
void stateChanged();
|
||||
@@ -145,21 +153,10 @@ signals:
|
||||
void visibleFeaturesChanged(quint64 features);
|
||||
void recordedFeaturesChanged(quint64 features);
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void restrictToRange(qint64 startTime, qint64 endTime);
|
||||
bool isRestrictedToRange() const;
|
||||
|
||||
void startAcquiring();
|
||||
|
||||
void save(const QString &filename);
|
||||
void load(const QString &filename);
|
||||
|
||||
private:
|
||||
void setState(State state);
|
||||
void detailsChanged(int typeId, const QString &newString);
|
||||
|
||||
private:
|
||||
class QmlProfilerModelManagerPrivate;
|
||||
QmlProfilerModelManagerPrivate *d;
|
||||
};
|
||||
|
@@ -51,6 +51,12 @@ public:
|
||||
|
||||
QString currentStateAsString();
|
||||
|
||||
void setCurrentState(QmlProfilerState newState);
|
||||
void setClientRecording(bool recording);
|
||||
void setServerRecording(bool recording);
|
||||
void setRequestedFeatures(quint64 features);
|
||||
void setRecordedFeatures(quint64 features);
|
||||
|
||||
signals:
|
||||
void stateChanged();
|
||||
void clientRecordingChanged(bool);
|
||||
@@ -58,13 +64,6 @@ signals:
|
||||
void requestedFeaturesChanged(quint64);
|
||||
void recordedFeaturesChanged(quint64);
|
||||
|
||||
public slots:
|
||||
void setCurrentState(QmlProfilerState newState);
|
||||
void setClientRecording(bool recording);
|
||||
void setServerRecording(bool recording);
|
||||
void setRequestedFeatures(quint64 features);
|
||||
void setRecordedFeatures(quint64 features);
|
||||
|
||||
private:
|
||||
class QmlProfilerStateManagerPrivate;
|
||||
QmlProfilerStateManagerPrivate *d;
|
||||
|
@@ -41,13 +41,12 @@ public:
|
||||
QmlProfilerModelManager *modelManager, QWidget *parent = 0);
|
||||
~QmlProfilerStateWidget();
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void showText(const QString &text);
|
||||
void updateDisplay();
|
||||
void update();
|
||||
void reposition();
|
||||
|
||||
private:
|
||||
class QmlProfilerStateWidgetPrivate;
|
||||
QmlProfilerStateWidgetPrivate *d;
|
||||
};
|
||||
|
@@ -87,11 +87,9 @@ private:
|
||||
void loadEvent(const QmlEvent &event, const QmlEventType &type);
|
||||
void finalize();
|
||||
|
||||
private slots:
|
||||
void dataChanged();
|
||||
void notesChanged(int typeIndex);
|
||||
|
||||
private:
|
||||
class QmlProfilerStatisticsModelPrivate;
|
||||
QmlProfilerStatisticsModelPrivate *d;
|
||||
};
|
||||
|
@@ -82,7 +82,6 @@ public:
|
||||
QString summary(const QVector<int> &typeIds) const;
|
||||
QStringList details(int typeId) const;
|
||||
|
||||
public slots:
|
||||
void selectByTypeId(int typeIndex) override;
|
||||
void onVisibleFeaturesChanged(quint64 features) override;
|
||||
|
||||
@@ -121,27 +120,24 @@ public:
|
||||
void setShowExtendedStatistics(bool);
|
||||
bool showExtendedStatistics() const;
|
||||
|
||||
signals:
|
||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||
void typeSelected(int typeIndex);
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void jumpToItem(const QModelIndex &index);
|
||||
void selectType(int typeIndex);
|
||||
void buildModel();
|
||||
void updateNotes(int typeIndex);
|
||||
|
||||
signals:
|
||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||
void typeSelected(int typeIndex);
|
||||
|
||||
private:
|
||||
void selectItem(const QStandardItem *item);
|
||||
void setHeaderLabels();
|
||||
void parseModel();
|
||||
QStandardItem *itemFromIndex(const QModelIndex &index) const;
|
||||
|
||||
private:
|
||||
class QmlProfilerStatisticsMainViewPrivate;
|
||||
QmlProfilerStatisticsMainViewPrivate *d;
|
||||
|
||||
};
|
||||
|
||||
class QmlProfilerStatisticsRelativesView : public Utils::TreeView
|
||||
@@ -152,15 +148,14 @@ public:
|
||||
QWidget *parent);
|
||||
~QmlProfilerStatisticsRelativesView();
|
||||
|
||||
signals:
|
||||
void typeClicked(int typeIndex);
|
||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||
|
||||
public slots:
|
||||
void displayType(int typeIndex);
|
||||
void jumpToItem(const QModelIndex &);
|
||||
void clear();
|
||||
|
||||
signals:
|
||||
void typeClicked(int typeIndex);
|
||||
void gotoSourceLocation(const QString &fileName, int lineNumber, int columnNumber);
|
||||
|
||||
private:
|
||||
void rebuildTree(const QmlProfilerStatisticsRelativesModel::QmlStatisticsRelativesMap &map);
|
||||
void updateHeader();
|
||||
|
@@ -55,14 +55,13 @@ public:
|
||||
virtual void loadEvent(const QmlEvent &event, const QmlEventType &type) = 0;
|
||||
virtual void finalize() = 0;
|
||||
|
||||
private slots:
|
||||
void dataChanged();
|
||||
void onVisibleFeaturesChanged(quint64 features);
|
||||
|
||||
protected:
|
||||
void announceFeatures(quint64 features);
|
||||
|
||||
private:
|
||||
void dataChanged();
|
||||
void onVisibleFeaturesChanged(quint64 features);
|
||||
|
||||
const Message m_message;
|
||||
const RangeType m_rangeType;
|
||||
const ProfileFeature m_mainFeature;
|
||||
|
@@ -64,7 +64,6 @@ public:
|
||||
|
||||
static QmlProfilerClientManager *clientManager();
|
||||
|
||||
public slots:
|
||||
void profilerStateChanged();
|
||||
void serverRecordingChanged();
|
||||
void clientsDisconnected();
|
||||
@@ -74,7 +73,7 @@ public slots:
|
||||
|
||||
void gotoSourceLocation(const QString &fileUrl, int lineNumber, int columnNumber);
|
||||
|
||||
private slots:
|
||||
private:
|
||||
void clearData();
|
||||
void showErrorDialog(const QString &error);
|
||||
void profilerDataModelStateChanged();
|
||||
@@ -90,7 +89,6 @@ private slots:
|
||||
void toggleRequestedFeature(QAction *action);
|
||||
void toggleVisibleFeature(QAction *action);
|
||||
|
||||
private:
|
||||
void updateRunActions();
|
||||
void clearDisplay();
|
||||
template<ProfileFeature feature>
|
||||
|
@@ -53,7 +53,6 @@ public:
|
||||
void setRecording(bool);
|
||||
quint64 recordedFeatures() const;
|
||||
|
||||
public slots:
|
||||
void clearData();
|
||||
void sendRecordingStatus(int engineId = -1);
|
||||
void setRequestedFeatures(quint64 features);
|
||||
|
@@ -183,8 +183,8 @@ QmlProfilerTraceView::QmlProfilerTraceView(QWidget *parent, QmlProfilerViewManag
|
||||
d->m_zoomControl);
|
||||
d->m_mainView->setSource(QUrl(QLatin1String("qrc:/timeline/MainView.qml")));
|
||||
|
||||
QQuickItem *rootObject = d->m_mainView->rootObject();
|
||||
connect(rootObject, SIGNAL(updateCursorPosition()), this, SLOT(updateCursorPosition()));
|
||||
connect(d->m_modelProxy, &Timeline::TimelineModelAggregator::updateCursorPosition,
|
||||
this, &QmlProfilerTraceView::updateCursorPosition);
|
||||
}
|
||||
|
||||
QmlProfilerTraceView::~QmlProfilerTraceView()
|
||||
|
@@ -55,7 +55,6 @@ public:
|
||||
bool isUsable() const;
|
||||
bool isSuspended() const;
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void selectByTypeId(int typeId);
|
||||
void selectByEventIndex(int modelId, int eventIndex);
|
||||
|
Reference in New Issue
Block a user