Make TaskMarks clickable and jump to the right task in the taskwindow

That means it is no longer possible to make bookmarks on lines with
errors or warnings by simply clicking. That's not nice.
It might be better to do something different, but let's see how the
feedback to this is.

Change-Id: I34788ff638ed49c21001d03cd60f992ffabd6153
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Daniel Teske
2012-02-29 16:15:25 +01:00
parent 407e1eaa9f
commit 6f0fa5114d
10 changed files with 74 additions and 4 deletions

View File

@@ -4443,12 +4443,22 @@ void BaseTextEditorWidget::extraAreaMouseEvent(QMouseEvent *e)
int n = d->extraAreaToggleMarkBlockNumber;
d->extraAreaToggleMarkBlockNumber = -1;
if (cursor.blockNumber() == n) {
if (TextBlockUserData *data = static_cast<TextBlockUserData *>(cursor.block().userData())) {
foreach (ITextMark *mark, data->marks()) {
if (mark->clickable()) {
mark->clicked();
return;
}
}
}
int line = n + 1;
ITextEditor::MarkRequestKind kind;
if (QApplication::keyboardModifiers() & Qt::ShiftModifier)
kind = ITextEditor::BookmarkRequest;
else
kind = ITextEditor::BreakpointRequest;
emit editor()->markRequested(editor(), line, kind);
}
}