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

QTextEdit, Qt::TextSelectableByKeyboard: cursor does not blink and remains visible when focus leaves

    XMLWordPrintable

Details

    • 0613bf5d160e79476435da54f2cad2676de4a558 (qt/qtbase/5.15)
    • Q1/2020 Finale

    Description

      #include <QApplication>
      #include <QLineEdit>
      #include <QTextEdit>
      #include <QVBoxLayout>
      
      int main(int argc, char **argv)
      {
        QApplication app(argc, argv);
      
        QWidget window;
        QVBoxLayout layout(&window);
      
        QLineEdit lineEdit;
        layout.addWidget(&lineEdit);
      
        QTextEdit textEdit;
        textEdit.setTextInteractionFlags(Qt::TextSelectableByKeyboard);
        layout.addWidget(&textEdit);
      
        window.show();
      
        return QApplication::exec();
      }

      When textEdit receives focus, the cursor becomes visible but does not blink: QWidgetTextControlPrivate::focusEvent assigns true to cursorOn but does not call setCursorVisible.

      When textEdit loses focus, the cursor remains visible: setCursorVisible is called, but does nothing.

      Related: here the Qt::TextSelectableByKeyboard flag should also be considered.

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            a.khlyustov a.khlyustov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes