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

QTextEdit clips placeholder text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.10.0 FF
    • 6.4.0, 6.5.3, 6.7.1
    • None
    • Windows 10
    • Windows
    • f7feed5ee (dev)

    Description

      When a short (not tall) QTextEdit widget has placeholder text, the bottom pixels are clipped off. This is despite that the height is sufficient. To demonstrate this, execute the code below and note that the two QTextEdit widgets have the same text contents (at the same baseline), but the placeholder text is clipped. See attached screenshots.

       
      #include <QSize>
      #include <QLineEdit>
      #include <QTextEdit>
       
        const QSize size(QLineEdit{}.sizeHint());
        QTextEdit textedit1, textedit2;
        textedit1.setFixedSize(size);
        textedit2.setFixedSize(size);
       
        textedit1.setText(QStringLiteral("pQy"));
        textedit2.setPlaceholderText(QStringLiteral("pQy"));
       
        textedit1.move(10,0);
        textedit1.move(50+size.width(),0);
       
        textedit1.show(); // okay
        textedit2.show(); // bottom pixels of text are clipped off
       

      Attachments

        For Gerrit Dashboard: QTBUG-116016
        # Subject Branch Project Status CR V

        Activity

          People

            morteza.jamshidi Morteza Jamshidi
            ev E Visser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes