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

QLineEdit emits editingFinished() when readOnly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.12.1
    • None
    • All

    Description

      A QLineEdit emits editingFinished() signals even when set to readOnly(true) which it surely should not do as read-only.

      Try the following snippet:

      QLineEdit* l = new QLineEdit();
       CHECK_TRUE(connect(l, &QLineEdit::editingFinished, this, [&](){ qDebug() << "Hello!"; }));
       l->setReadOnly(true);
       l->show();

      Run it, then click the line edit (giving it focus) then click somewhere else (removing focus from line edit). You will see a "Hello!" in the output console which means the signal was emitted.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              silicomancer Bernhard Lindner
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes