diff options
author | David Schulz <david.schulz@qt.io> | 2017-06-23 08:44:00 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2017-06-30 08:30:21 +0000 |
commit | 0f7e69034e0b800b559d777085d58f6fb2006036 (patch) | |
tree | b89129ef5f81c977a58c489b8edc5e2e85e7a0f8 | |
parent | 6591a01452918ce40ca101bb6cfe9770a44d16be (diff) | |
download | qt-creator-0f7e69034e0b800b559d777085d58f6fb2006036.tar.gz |
Bookmark: make bookmarks draggable
Task-number: QTCREATORBUG-9721
Change-Id: I157e2c4a15ae9d7e4942d3be378ecd01ef493155
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r-- | src/plugins/bookmarks/bookmark.cpp | 11 | ||||
-rw-r--r-- | src/plugins/bookmarks/bookmark.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/bookmarks/bookmark.cpp b/src/plugins/bookmarks/bookmark.cpp index e24f734ee4..dd8f71fb03 100644 --- a/src/plugins/bookmarks/bookmark.cpp +++ b/src/plugins/bookmarks/bookmark.cpp @@ -50,6 +50,16 @@ void Bookmark::removedFromEditor() m_manager->deleteBookmark(this); } +bool Bookmark::isDraggable() const +{ + return true; +} + +void Bookmark::dragToLine(int lineNumber) +{ + move(lineNumber); +} + void Bookmark::updateLineNumber(int line) { if (line != lineNumber()) { @@ -63,6 +73,7 @@ void Bookmark::move(int line) if (line != lineNumber()) { TextMark::move(line); m_manager->updateBookmark(this); + updateMarker(); } } diff --git a/src/plugins/bookmarks/bookmark.h b/src/plugins/bookmarks/bookmark.h index 6d818946ff..ad9a1d7f53 100644 --- a/src/plugins/bookmarks/bookmark.h +++ b/src/plugins/bookmarks/bookmark.h @@ -43,6 +43,9 @@ public: void updateFileName(const QString &fileName) override; void removedFromEditor() override; + bool isDraggable() const override; + void dragToLine(int lineNumber) override; + void setNote(const QString ¬e); void updateNote(const QString ¬e); |