Commit 786e183a authored by mae's avatar mae
Browse files

markContextMenuRequested signal in ITextEditor

parent 923bfa52
...@@ -488,10 +488,6 @@ ITextEditable *BaseTextEditor::editableInterface() const ...@@ -488,10 +488,6 @@ ITextEditable *BaseTextEditor::editableInterface() const
d->m_editable, SIGNAL(contentsChanged())); d->m_editable, SIGNAL(contentsChanged()));
connect(this, SIGNAL(changed()), connect(this, SIGNAL(changed()),
d->m_editable, SIGNAL(changed())); d->m_editable, SIGNAL(changed()));
connect(this,
SIGNAL(markRequested(TextEditor::ITextEditor *, int)),
d->m_editable,
SIGNAL(markRequested(TextEditor::ITextEditor *, int)));
} }
return d->m_editable; return d->m_editable;
} }
...@@ -2434,9 +2430,10 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e) ...@@ -2434,9 +2430,10 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
} }
} else if (e->button() == Qt::RightButton) { } else if (e->button() == Qt::RightButton) {
QMenu * contextMenu = new QMenu(this); QMenu * contextMenu = new QMenu(this);
emit lineContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu); emit d->m_editable->markContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu);
if (!contextMenu->isEmpty()) if (!contextMenu->isEmpty())
contextMenu->exec(e->globalPos()); contextMenu->exec(e->globalPos());
delete contextMenu;
} }
} else if (d->extraAreaSelectionAnchorBlockNumber >= 0) { } else if (d->extraAreaSelectionAnchorBlockNumber >= 0) {
QTextCursor selection = cursor; QTextCursor selection = cursor;
...@@ -2471,7 +2468,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e) ...@@ -2471,7 +2468,7 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
d->extraAreaToggleMarkBlockNumber = -1; d->extraAreaToggleMarkBlockNumber = -1;
if (cursor.blockNumber() == n) { if (cursor.blockNumber() == n) {
int line = n + 1; int line = n + 1;
emit markRequested(editableInterface(), line); emit d->m_editable->markRequested(editableInterface(), line);
} }
} }
} }
......
...@@ -431,8 +431,6 @@ protected slots: ...@@ -431,8 +431,6 @@ protected slots:
signals: signals:
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);
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <QtGui/QIcon> #include <QtGui/QIcon>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QMenu;
class QTextBlock; class QTextBlock;
QT_END_NAMESPACE QT_END_NAMESPACE
...@@ -124,6 +125,7 @@ public: ...@@ -124,6 +125,7 @@ public:
signals: signals:
void contentsChanged(); void contentsChanged();
void markRequested(TextEditor::ITextEditor *editor, int line); void markRequested(TextEditor::ITextEditor *editor, int line);
void markContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);
void tooltipRequested(TextEditor::ITextEditor *editor, const QPoint &globalPos, int position); void tooltipRequested(TextEditor::ITextEditor *editor, const QPoint &globalPos, int position);
void contextHelpIdRequested(TextEditor::ITextEditor *editor, int position); void contextHelpIdRequested(TextEditor::ITextEditor *editor, int position);
}; };
......
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