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

Cursor not displayed at right margin of QPlainTextEdit

XMLWordPrintable

    • Linux/Wayland
    • 7451fb36fd1de38868c6c9a48da0b1b66a771672 (qt/qtbase/dev) 3cbb190c5586001756fe69637db0e584575d279f (qt/tqtc-qtbase/5.15)

      Consider the following example code:

      #include <QApplication>
      #include <QHBoxLayout>
      #include <QLineEdit>
      #include <QPlainTextEdit>
      #include <QTextEdit>
      #include <QWidget>
      
      int main(int argc, char **argv)
      {
          QApplication app(argc, argv);
      
          QWidget container;
          QHBoxLayout hbl(&container);
      
          QPlainTextEdit pte;
          hbl.addWidget(&pte);
          pte.setFixedHeight(QLineEdit().sizeHint().height());
          pte.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
          pte.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
          pte.setWordWrapMode(QTextOption::NoWrap);
          pte.setTabChangesFocus(true);
      
          QTextEdit te;
          hbl.addWidget(&te);
          te.setFixedHeight(QLineEdit().sizeHint().height());
          te.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
          te.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
          te.setWordWrapMode(QTextOption::NoWrap);
          te.setTabChangesFocus(true);
      
          container.show();
      
          return app.exec();
      }
      

      When the cursor reaches the right margin of the QPlainTextEdit it is sometimes initially drawn but vanishes when blinking should happen. The QTextEdit does not show that defect.

      Sometimes it is necessary to delete the last characters and type one ore two more to trigger the problem.

       

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mlangen Marc Langenbach
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes