forked from qt-creator/qt-creator
QmlProfiler: show binding types
Change-Id: Iea469aa3e0fb7c4e5146163f049c930df6fc2b7d Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
committed by
Kai Koehne
parent
c4f67a3840
commit
2afa559c2a
@@ -164,9 +164,9 @@ void QmlProfilerClientManager::connectClientSignals()
|
||||
connect(d->qmlclientplugin.data(), SIGNAL(complete()),
|
||||
this, SLOT(qmlComplete()));
|
||||
connect(d->qmlclientplugin.data(),
|
||||
SIGNAL(range(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)),
|
||||
SIGNAL(range(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)),
|
||||
this,
|
||||
SIGNAL(addRangedEvent(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)));
|
||||
SIGNAL(addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)));
|
||||
connect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)),
|
||||
this, SIGNAL(traceFinished(qint64)));
|
||||
connect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64)),
|
||||
@@ -196,9 +196,9 @@ void QmlProfilerClientManager::disconnectClientSignals()
|
||||
disconnect(d->qmlclientplugin.data(), SIGNAL(complete()),
|
||||
this, SLOT(qmlComplete()));
|
||||
disconnect(d->qmlclientplugin.data(),
|
||||
SIGNAL(range(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)),
|
||||
SIGNAL(range(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)),
|
||||
this,
|
||||
SIGNAL(addRangedEvent(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)));
|
||||
SIGNAL(addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)));
|
||||
disconnect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)),
|
||||
this, SIGNAL(traceFinished(qint64)));
|
||||
disconnect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64)),
|
||||
|
||||
@@ -61,7 +61,7 @@ signals:
|
||||
void connectionFailed();
|
||||
|
||||
// data
|
||||
void addRangedEvent(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation);
|
||||
void addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation);
|
||||
void addV8Event(int,QString,QString,int,double,double);
|
||||
void addFrameEvent(qint64,int,int);
|
||||
void traceStarted(qint64);
|
||||
|
||||
@@ -293,8 +293,8 @@ void QmlProfilerDataModel::clear()
|
||||
setState(Empty);
|
||||
}
|
||||
|
||||
void QmlProfilerDataModel::addRangedEvent(int type, qint64 startTime, qint64 length,
|
||||
const QStringList &data,
|
||||
void QmlProfilerDataModel::addRangedEvent(int type, int bindingType, qint64 startTime,
|
||||
qint64 length, const QStringList &data,
|
||||
const QmlDebug::QmlEventLocation &location)
|
||||
{
|
||||
const QChar colon = QLatin1Char(':');
|
||||
@@ -346,6 +346,7 @@ void QmlProfilerDataModel::addRangedEvent(int type, qint64 startTime, qint64 len
|
||||
newEvent->eventHashStr = eventHashStr;
|
||||
newEvent->eventType = (QmlDebug::QmlEventType)type;
|
||||
newEvent->details = details;
|
||||
newEvent->bindingType = bindingType;
|
||||
d->rangeEventDictionary.insert(eventHashStr, newEvent);
|
||||
}
|
||||
|
||||
@@ -1367,6 +1368,8 @@ bool QmlProfilerDataModel::save(const QString &filename)
|
||||
stream.writeTextElement("column", QString::number(eventData->location.column));
|
||||
}
|
||||
stream.writeTextElement("details", eventData->details);
|
||||
if (eventData->eventType == Binding)
|
||||
stream.writeTextElement("bindingType", QString::number((int)eventData->bindingType));
|
||||
stream.writeEndElement();
|
||||
}
|
||||
stream.writeEndElement(); // eventData
|
||||
@@ -1513,6 +1516,8 @@ void QmlProfilerDataModel::load()
|
||||
if (!descriptionBuffer.value(ndx))
|
||||
descriptionBuffer[ndx] = new QmlRangeEventData;
|
||||
currentEvent = descriptionBuffer[ndx];
|
||||
// backwards compatibility: default bindingType
|
||||
currentEvent->bindingType = QmlBinding;
|
||||
} else {
|
||||
currentEvent = 0;
|
||||
}
|
||||
@@ -1551,6 +1556,10 @@ void QmlProfilerDataModel::load()
|
||||
currentEvent->details = readData;
|
||||
break;
|
||||
}
|
||||
if (elementName == "bindingType") {
|
||||
currentEvent->bindingType = readData.toInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ struct QmlRangeEventData
|
||||
~QmlRangeEventData();
|
||||
|
||||
int eventId;
|
||||
int bindingType;
|
||||
QString displayName;
|
||||
QString eventHashStr;
|
||||
QString details;
|
||||
@@ -167,7 +168,7 @@ signals:
|
||||
public slots:
|
||||
void clear();
|
||||
|
||||
void addRangedEvent(int type, qint64 startTime, qint64 length,
|
||||
void addRangedEvent(int type, int bindingType, qint64 startTime, qint64 length,
|
||||
const QStringList &data, const QmlDebug::QmlEventLocation &location);
|
||||
void addV8Event(int depth,const QString &function,const QString &filename, int lineNumber, double totalTime, double selfTime);
|
||||
void addFrameEvent(qint64 time, int framerate, int animationcount);
|
||||
|
||||
@@ -82,8 +82,8 @@ public:
|
||||
// first column
|
||||
if (column() == 0) {
|
||||
return data(FilenameRole).toString() == other.data(FilenameRole).toString() ?
|
||||
data(LineRole).toInt() < other.data(LineRole).toInt() :
|
||||
data(FilenameRole).toString() < other.data(FilenameRole).toString();
|
||||
data(LineRole).toInt() < other.data(LineRole).toInt() :
|
||||
data(FilenameRole).toString() < other.data(FilenameRole).toString();
|
||||
} else {
|
||||
return data().toString().toLower() < other.data().toString().toLower();
|
||||
}
|
||||
@@ -115,9 +115,9 @@ public:
|
||||
};
|
||||
|
||||
QmlProfilerEventsWidget::QmlProfilerEventsWidget(QWidget *parent,
|
||||
Analyzer::IAnalyzerTool *profilerTool,
|
||||
QmlProfilerViewManager *container,
|
||||
QmlProfilerDataModel *profilerDataModel )
|
||||
Analyzer::IAnalyzerTool *profilerTool,
|
||||
QmlProfilerViewManager *container,
|
||||
QmlProfilerDataModel *profilerDataModel )
|
||||
: QWidget(parent), d(new QmlProfilerEventsWidgetPrivate(this))
|
||||
{
|
||||
setObjectName("QmlProfilerEventsView");
|
||||
@@ -603,8 +603,16 @@ void QmlProfilerEventsMainView::QmlProfilerEventsMainViewPrivate::buildModelFrom
|
||||
}
|
||||
|
||||
if (m_fieldShown[Type]) {
|
||||
newRow << new EventsViewItem(QmlProfilerEventsMainView::nameForType(binding->eventType));
|
||||
newRow.last()->setData(QVariant(QmlProfilerEventsMainView::nameForType(binding->eventType)));
|
||||
QString typeString = QmlProfilerEventsMainView::nameForType(binding->eventType);
|
||||
QString toolTipText;
|
||||
if (binding->eventType == Binding && binding->bindingType == (int)V4Binding) {
|
||||
typeString = typeString + tr(" (v4)");
|
||||
toolTipText = qsTr("Binding is evaluated by the optimized v4 engine.");
|
||||
}
|
||||
newRow << new EventsViewItem(typeString);
|
||||
newRow.last()->setData(QVariant(typeString));
|
||||
if (!toolTipText.isEmpty())
|
||||
newRow.last()->setToolTip(toolTipText);
|
||||
}
|
||||
|
||||
if (m_fieldShown[Percent]) {
|
||||
|
||||
@@ -152,8 +152,14 @@ QmlProfilerTool::QmlProfilerTool(QObject *parent)
|
||||
d->m_profilerDataModel = new QmlProfilerDataModel(this);
|
||||
connect(d->m_profilerDataModel, SIGNAL(stateChanged()), this, SLOT(profilerDataModelStateChanged()));
|
||||
connect(d->m_profilerDataModel, SIGNAL(error(QString)), this, SLOT(showErrorDialog(QString)));
|
||||
connect(d->m_profilerConnections, SIGNAL(addRangedEvent(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)), d->m_profilerDataModel, SLOT(addRangedEvent(int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)));
|
||||
connect(d->m_profilerConnections, SIGNAL(addV8Event(int,QString,QString,int,double,double)), d->m_profilerDataModel, SLOT(addV8Event(int,QString,QString,int,double,double)));
|
||||
connect(d->m_profilerConnections,
|
||||
SIGNAL(addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)),
|
||||
d->m_profilerDataModel,
|
||||
SLOT(addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)));
|
||||
connect(d->m_profilerConnections,
|
||||
SIGNAL(addV8Event(int,QString,QString,int,double,double)),
|
||||
d->m_profilerDataModel,
|
||||
SLOT(addV8Event(int,QString,QString,int,double,double)));
|
||||
connect(d->m_profilerConnections, SIGNAL(addFrameEvent(qint64,int,int)), d->m_profilerDataModel, SLOT(addFrameEvent(qint64,int,int)));
|
||||
connect(d->m_profilerConnections, SIGNAL(traceStarted(qint64)), d->m_profilerDataModel, SLOT(setTraceStartTime(qint64)));
|
||||
connect(d->m_profilerConnections, SIGNAL(traceFinished(qint64)), d->m_profilerDataModel, SLOT(setTraceEndTime(qint64)));
|
||||
|
||||
Reference in New Issue
Block a user