forked from qt-creator/qt-creator
TextEditor: Use callback in refactoring markers
Allows to trigger actions without adding specific handling into the editor. Change-Id: Ia63d65d3feca37bcefca1b6322ade039027a92d8 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -27,22 +27,30 @@
|
||||
|
||||
#include "texteditor_global.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
|
||||
#include <QTextCursor>
|
||||
#include <QIcon>
|
||||
|
||||
namespace TextEditor {
|
||||
class TextEditorWidget;
|
||||
|
||||
struct TEXTEDITOR_EXPORT RefactorMarker {
|
||||
struct TEXTEDITOR_EXPORT RefactorMarker;
|
||||
using RefactorMarkers = QList<RefactorMarker>;
|
||||
|
||||
struct TEXTEDITOR_EXPORT RefactorMarker {
|
||||
inline bool isValid() const { return !cursor.isNull(); }
|
||||
QTextCursor cursor;
|
||||
QString tooltip;
|
||||
QIcon icon;
|
||||
mutable QRect rect; // used to cache last drawing positin in document coordinates
|
||||
std::function<void(TextEditor::TextEditorWidget *)> callback;
|
||||
Core::Id type;
|
||||
QVariant data;
|
||||
|
||||
static RefactorMarkers filterOutType(const RefactorMarkers &markers, const Core::Id &type);
|
||||
};
|
||||
|
||||
using RefactorMarkers = QList<RefactorMarker>;
|
||||
|
||||
class TEXTEDITOR_EXPORT RefactorOverlay : public QObject
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user