Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QTextEdit Block clear..?



  • How can I block-clear a selected character (drag block character) of QTextEdit?

    0_1548116540294_778543b5-60e8-452a-8c28-f534f4b2ead4-image.png



  • Use if(QTextCursor::hasSelection()) QTextCursor::removeSelectedText()

    Edit:
    QTextCursor textCursor = textEdit->textCursor();
    if(textCursor.hasSelection())
    {
    textCursor.removeSelectedText()
    }


Log in to reply