QmlProfiler: Provide a sane ctor for QmlEventType and use it

... in turn, make its members private, so that we don't accidentally
change them.

Change-Id: Ibc65b406ee341d33f69647ed1b19e1e34f5cd535
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2016-06-06 19:51:55 +02:00
parent 5718f12af5
commit e10bc709bc
23 changed files with 267 additions and 318 deletions

View File

@@ -45,23 +45,17 @@ void FlameGraphModelTest::generateData(QmlProfilerModelManager *manager)
manager->startAcquiring();
QmlEvent event;
QmlEventType type;
event.setTypeIndex(-1);
type.displayName.clear();
type.data = QLatin1String("funcfunc");
type.rangeType = MaximumRangeType;
type.detailType = -1;
type.message = MaximumMessage;
QStack<int> typeIndices;
int i = 0;
while (i < 10) {
int typeIndex = -1;
if (i < 5) {
type.location = QmlEventLocation("somefile.js", i, 20 - i);
type.rangeType = static_cast<RangeType>(static_cast<int>(Javascript) - i);
QmlEventType type(MaximumMessage,
static_cast<RangeType>(static_cast<int>(Javascript) - i),
-1, QmlEventLocation("somefile.js", i, 20 - i), QString("funcfunc"));
typeIndex = manager->qmlModel()->addEventType(type);
} else {
typeIndex = typeIndices[i - 5];