Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit ab182918 authored by Laurent Montel's avatar Laurent Montel 😁

Don't use shortcut

parent e11f0694
......@@ -104,11 +104,6 @@ PlainTextEditor::PlainTextEditor(QWidget *parent)
KCursor::setAutoHideCursor(this, true, false);
setSpellCheckingConfigFileName(QString());
d->mInitialFontSize = font().pointSize();
QShortcut *moveUp = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up), this);
connect(moveUp, &QShortcut::activated, [this]() {moveLineUpDown(true);});
QShortcut *moveDown = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down), this);
connect(moveDown, &QShortcut::activated, [this]() {moveLineUpDown(false);});
}
PlainTextEditor::~PlainTextEditor()
......@@ -714,6 +709,13 @@ void PlainTextEditor::keyPressEvent(QKeyEvent *event)
{
if (handleShortcut(event)) {
event->accept();
} else if (event->key() == Qt::Key_Up && event->modifiers() == Qt::CTRL) {
moveLineUpDown(true);
qDebug() << "ssssssssss";
event->accept();
} else if (event->key() == Qt::Key_Down && event->modifiers() == Qt::CTRL) {
moveLineUpDown(false);
event->accept();
} else {
QPlainTextEdit::keyPressEvent(event);
}
......
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