forked from qt-creator/qt-creator
new signal: BaseTextEditor::lineContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);
To be useful and used by the bookmarkmanager, this has to move to ITextEditor.
This commit is contained in:
@@ -79,6 +79,7 @@
|
|||||||
#include <QtGui/QToolBar>
|
#include <QtGui/QToolBar>
|
||||||
#include <QtGui/QToolTip>
|
#include <QtGui/QToolTip>
|
||||||
#include <QtGui/QInputDialog>
|
#include <QtGui/QInputDialog>
|
||||||
|
#include <QtGui/QMenu>
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
@@ -2430,6 +2431,11 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
|
|||||||
} else {
|
} else {
|
||||||
d->extraAreaToggleMarkBlockNumber = cursor.blockNumber();
|
d->extraAreaToggleMarkBlockNumber = cursor.blockNumber();
|
||||||
}
|
}
|
||||||
|
} else if (e->button() == Qt::RightButton) {
|
||||||
|
QMenu * contextMenu = new QMenu(this);
|
||||||
|
emit lineContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu);
|
||||||
|
if (!contextMenu->isEmpty())
|
||||||
|
contextMenu->exec(e->globalPos());
|
||||||
}
|
}
|
||||||
} else if (d->extraAreaSelectionAnchorBlockNumber >= 0) {
|
} else if (d->extraAreaSelectionAnchorBlockNumber >= 0) {
|
||||||
QTextCursor selection = cursor;
|
QTextCursor selection = cursor;
|
||||||
|
|||||||
@@ -432,6 +432,7 @@ protected slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void markRequested(TextEditor::ITextEditor *editor, int line);
|
void markRequested(TextEditor::ITextEditor *editor, int line);
|
||||||
|
void lineContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);
|
||||||
void requestBlockUpdate(const QTextBlock &);
|
void requestBlockUpdate(const QTextBlock &);
|
||||||
void requestAutoCompletion(ITextEditable *editor, bool forced);
|
void requestAutoCompletion(ITextEditable *editor, bool forced);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user