Added an option to disable the mouse navigation

It's conflicting too much with pasting for some, so better have the
option to just turn it off.
This commit is contained in:
Thorbjørn Lindeijer
2009-05-13 16:05:11 +02:00
parent e913f8289b
commit cf44cbf58e
7 changed files with 40 additions and 7 deletions

View File

@@ -189,6 +189,7 @@ CPPEditorEditable::CPPEditorEditable(CPPEditor *editor)
CPPEditor::CPPEditor(QWidget *parent)
: TextEditor::BaseTextEditor(parent)
, m_mouseNavigationEnabled(true)
, m_showingLink(false)
{
setParenthesesMatchingEnabled(true);
@@ -901,7 +902,7 @@ void CPPEditor::mouseMoveEvent(QMouseEvent *e)
{
bool linkFound = false;
if (e->modifiers() & Qt::ControlModifier) {
if (m_mouseNavigationEnabled && e->modifiers() & Qt::ControlModifier) {
// Link emulation behaviour for 'go to definition'
const QTextCursor cursor = cursorForPosition(e->pos());
@@ -1027,6 +1028,11 @@ void CPPEditor::setFontSettings(const TextEditor::FontSettings &fs)
m_linkFormat = fs.toTextCharFormat(QLatin1String(TextEditor::Constants::C_LINK));
}
void CPPEditor::setDisplaySettings(const TextEditor::DisplaySettings &ds)
{
TextEditor::BaseTextEditor::setDisplaySettings(ds);
m_mouseNavigationEnabled = ds.m_mouseNavigation;
}
void CPPEditor::unCommentSelection()
{