QmlProfiler: Make sure only hovered events are selected

Task-number: QTCREATORBUG-11824
Change-Id: Ib471f2a04b37e159fb7876e7f5c94ad3e8f368a9
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-03-26 17:06:26 +01:00
parent 20e2d1eb7d
commit f0e2196869

View File

@@ -350,10 +350,16 @@ void TimelineRenderer::manageHovered(int mouseX, int mouseY)
itemRow = modelRowStart + m_profilerModelProxy->getEventRow(modelIndex, i);
if (itemRow == row) {
// There can be small events that don't reach the cursor position after large events
// that do but are in a different row.
qint64 itemEnd = m_profilerModelProxy->getEndTime(modelIndex, i);
if (itemEnd < startTime)
continue;
// match
m_currentSelection.eventIndex = i;
m_currentSelection.startTime = m_profilerModelProxy->getStartTime(modelIndex, i);
m_currentSelection.endTime = m_profilerModelProxy->getEndTime(modelIndex, i);
m_currentSelection.endTime = itemEnd;
m_currentSelection.row = row;
m_currentSelection.modelIndex = modelIndex;
if (!m_selectionLocked) {