Important: Please read the Qt Code of Conduct -

problem QPlainTextEdit setTopMargin

  • Hello.

    I have problem to use the setTopMargin on QPlainTextEdit .
    Not working.
    QTextEdit work fine.
    Area there another mehotd to do the same soluction?

            tc = self.textCursor()
            tc.movePosition(QTextCursor.Down, QTextCursor.MoveAnchor, 5)
            tc.movePosition(QTextCursor.Right, QTextCursor.MoveAnchor, 0)
            fmt = tc.blockFormat()
            fmt.setTopMargin((18 * 6))

  • Lifetime Qt Champion


    As explained in the documentation QPlainTextEdit only supports limited text formatting.

Log in to reply