Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-81060

Empty line (\n) at the top of QTextEdit and QLabel when using markdown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.14.0
    • Fix Version/s: 5.14.1, 5.14.2, 5.15.0 Alpha
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Environment:
      Issue seen in a plain C++ environment, as well as in Pyside2 and PyQt5

      The issue has been seen on LXDE (Lubuntu 18.04), KDE and WIndows 8
    • Platform/s:
      Linux/X11, Windows
    • Commits:
      76fbe75abee7d77911467d56630176f777e8ed78 (qt/qtbase/5.14)

      Description

      We see an empty line (\n) at the top of QTextEdit and QLabel widgets when using markdown formatting

      Please note: This has not been tested on a C++ environment, so it's possible that the bug is only for Pyside2 and PyQt5
      Update: Has been seen in a plain C++ environment (see comment from Christian Ehrlicher), as well as on Pyside2 and PyQt5. (First found on PyQt5)

      Below is a minimal example (the result can be seen in the attached screenshot)

      import sys
      from Pyside2 import QtWidgets
      
      
      class MyMainWindow(QtWidgets.QMainWindow):
          def __init__(self):
              super().__init__()
      
              self.qte = QtWidgets.QTextEdit()
              self.qte.setReadOnly(True)
              self.qte.setMarkdown("Markdown text")
              self.setCentralWidget(self.qte)
      
              self.show()
      
      
      app = QtWidgets.QApplication(sys.argv)
      main_window = MyMainWindow()
      main_window.show()
      app.exec_()
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            rakeller Rainer Keller
            Reporter:
            sunyatazero Tord Dellsén
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes