diff --git a/src/plugins/qmlprofiler/qml/CategoryLabel.qml b/src/plugins/qmlprofiler/qml/CategoryLabel.qml index da26964af9f..75e3d2b02d9 100644 --- a/src/plugins/qmlprofiler/qml/CategoryLabel.qml +++ b/src/plugins/qmlprofiler/qml/CategoryLabel.qml @@ -55,7 +55,8 @@ Item { property bool reverseSelect: false - visible: trigger(qmlProfilerModelProxy.rowCount(modelIndex)) > 0 + visible: trigger(!qmlProfilerModelProxy.models[modelIndex].hidden && + !qmlProfilerModelProxy.models[modelIndex].empty) height: trigger(qmlProfilerModelProxy.models[modelIndex].height) width: 150 diff --git a/src/plugins/qmlprofiler/qml/TimeMarks.qml b/src/plugins/qmlprofiler/qml/TimeMarks.qml index c3b6082fd7f..085bec2179d 100644 --- a/src/plugins/qmlprofiler/qml/TimeMarks.qml +++ b/src/plugins/qmlprofiler/qml/TimeMarks.qml @@ -125,6 +125,8 @@ Canvas { var cumulatedHeight = y < 0 ? -y : 0; for (var modelIndex = 0; modelIndex < qmlProfilerModelProxy.modelCount(); ++modelIndex) { var modelHeight = qmlProfilerModelProxy.models[modelIndex].height; + if (modelHeight === 0) + continue; if (cumulatedHeight + modelHeight < y) { cumulatedHeight += modelHeight; if (qmlProfilerModelProxy.rowCount(modelIndex) % 2 !== 0) diff --git a/src/plugins/qmlprofiler/timelinemodel.cpp b/src/plugins/qmlprofiler/timelinemodel.cpp index c00f56c7509..5d936de52e5 100644 --- a/src/plugins/qmlprofiler/timelinemodel.cpp +++ b/src/plugins/qmlprofiler/timelinemodel.cpp @@ -218,6 +218,9 @@ void TimelineModel::setRowHeight(int rowNumber, int height) int TimelineModel::height() const { Q_D(const TimelineModel); + if (d->hidden || isEmpty()) + return 0; + int depth = rowCount(); if (d->hidden || !d->expanded || d->rowOffsets.empty()) return depth * TimelineModelPrivate::DefaultRowHeight; @@ -466,8 +469,6 @@ QString TimelineModel::displayName() const int TimelineModel::rowCount() const { Q_D(const TimelineModel); - if (d->hidden || isEmpty()) - return 0; return d->expanded ? d->expandedRowCount : d->collapsedRowCount; }