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

markContextMenuRequested signal in ITextEditor

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