Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void QPlainTextEdit::keyReleaseEvent ( QKeyEvent e  )  [protected, virtual]

Reimplemented from QWidget.

Definition at line 1689 of file qplaintextedit.cpp.

References QTextCursor::atBlockStart(), QTextCursor::block(), QTextCursor::blockFormat(), QTextCursor::currentList(), QTextCursor::deletePreviousChar(), QTextBlockFormat::indent(), QKeyEvent::isAutoRepeat(), QKeyEvent::key(), QTextList::remove(), QTextCursor::setBlockFormat(), QTextBlockFormat::setIndent(), and setTextCursor().

{
#ifdef QT_KEYPAD_NAVIGATION
    Q_D(QPlainTextEdit);
    if (QApplication::keypadNavigationEnabled()) {
        if (!e->isAutoRepeat() && e->key() == Qt::Key_Back
            && d->deleteAllTimer.isActive()) {
            d->deleteAllTimer.stop();
            QTextCursor cursor = d->control->textCursor();
            QTextBlockFormat blockFmt = cursor.blockFormat();

            QTextList *list = cursor.currentList();
            if (list && cursor.atBlockStart()) {
                list->remove(cursor.block());
            } else if (cursor.atBlockStart() && blockFmt.indent() > 0) {
                blockFmt.setIndent(blockFmt.indent() - 1);
                cursor.setBlockFormat(blockFmt);
            } else {
                cursor.deletePreviousChar();
            }
            setTextCursor(cursor);
        }
    }
#else
    Q_UNUSED(e);
#endif
}


Generated by  Doxygen 1.6.0   Back to index