Commit 987dccad authored by Ulf Hermann's avatar Ulf Hermann
Browse files

Timeline: Remove redundant itemPressed signal



selectedItemChanged is entirely enough to signal that the selection has
changed.

Change-Id: I1b5640c4ad4891ab9fadac83a53b202fdd6871a5
Reviewed-by: default avatarJoerg Bornemann <joerg.bornemann@theqtcompany.com>
parent 34569943
......@@ -186,22 +186,7 @@ ScrollView {
flick.contentY = (rowStart + rowEnd - scroller.height) / 2;
}
onSelectedItemChanged: {
scroller.propagateSelection(index, selectedItem);
}
onItemPressed: {
if (pressedItem === -1) {
// User clicked on empty space. Remove selection.
scroller.propagateSelection(-1, -1);
} else {
var location = model.location(pressedItem);
if (location.hasOwnProperty("file")) // not empty
scroller.gotoSourceLocation(location.file, location.line,
location.column);
scroller.typeId = model.typeId(pressedItem);
}
}
onSelectedItemChanged: scroller.propagateSelection(index, selectedItem);
}
}
......
......@@ -208,15 +208,10 @@ void TimelineRenderer::hoverMoveEvent(QHoverEvent *event)
void TimelineRenderer::TimelineRendererPrivate::manageClicked()
{
Q_Q(TimelineRenderer);
if (currentSelection.eventIndex != -1) {
// itemPressed() will trigger an update of the events and JavaScript views. Make sure the
// correct event is already selected when that happens, to prevent confusion.
if (currentSelection.eventIndex != -1)
q->setSelectedItem(currentSelection.eventIndex);
emit q->itemPressed(currentSelection.eventIndex);
} else {
else
q->setSelectedItem(-1);
emit q->itemPressed(-1);
}
}
void TimelineRenderer::TimelineRendererPrivate::manageHovered(int mouseX, int mouseY)
......
......@@ -57,9 +57,6 @@ public:
// TODO: We could add some Q_INVOKABLE functions to enable or disable render passes when the the
// need arises.
signals:
void itemPressed(int pressedItem);
public slots:
void clearData();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment