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

Unwanted interactivity with gap after QLineEdit action

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.10.0
    • None
    • Windows 8.1 x64

      Code to reproduce:

      #include <QApplication>
      #include <QWidget>
      #include <QVBoxLayout>
      #include <QLineEdit>
      
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QWidget widget;
          QVBoxLayout layout;
          widget.setLayout(&layout);
          QLineEdit lineEdit;
          layout.addWidget(&lineEdit);
          lineEdit.setClearButtonEnabled(true);
          lineEdit.setText("text"); // To show clear button
          widget.show();
      
          return a.exec();
      }
      

      Result:

      You will not see any text in this gap but you will be able to select text dragging mouse from this gap. In my opinion the gap area must be completely passive (don't handle clicks (both left and right), show standard cursor etc).

      Also works with:

      1. Actions added with QLineEdit::addAction;
      2. QComboBox (which contains QLineEdit inside).

        1. gap.png
          3 kB
          Yuri M
        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
            yuri_q Yuri M
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes