QCodeEdit now show links on Ctrl only without selection
This commit is contained in:
@@ -26,6 +26,7 @@ class _QCE_Viewport: public QWidget {
|
||||
public:
|
||||
_QCE_Viewport(QWidget * p = 0): QWidget(p) {
|
||||
setObjectName("__qcodeedit_viewport__");
|
||||
setMouseTracking(true);
|
||||
//setCursor(Qt::IBeamCursor);
|
||||
}
|
||||
|
||||
@@ -468,13 +469,16 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) {
|
||||
hideHelp();
|
||||
QMouseEvent * me = (QMouseEvent*)e;
|
||||
if (me->modifiers().testFlag(Qt::ControlModifier) && (me->button() == Qt::LeftButton))
|
||||
if (!hasBlockSelection() && !ui->textCode->textCursor().hasSelection())
|
||||
gotoLink();
|
||||
} break;
|
||||
case QEvent::MouseMove: {
|
||||
if (!completer->isHidden()) break;
|
||||
QMouseEvent * me = (QMouseEvent*)e;
|
||||
if (me->buttons() != 0)
|
||||
switchBlockSelection();
|
||||
if (me->modifiers().testFlag(Qt::ControlModifier))
|
||||
if (!hasBlockSelection() && !ui->textCode->textCursor().hasSelection())
|
||||
showLink();
|
||||
} break;
|
||||
case QEvent::Paint:
|
||||
@@ -697,6 +701,7 @@ bool QCodeEdit::codeKeyEvent(QKeyEvent * ke) {
|
||||
}
|
||||
break;
|
||||
case Qt::Key_Control:
|
||||
if (!hasBlockSelection() && !ui->textCode->textCursor().hasSelection())
|
||||
showLink();
|
||||
break;
|
||||
case Qt::Key_F1:
|
||||
|
||||
Reference in New Issue
Block a user