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

QLineEdit with clear button uses huge CPU resources when added in QToolBar

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.1
    • 5.6.1, 5.7.0, 5.12.0
    • None
    • Tested on KUbuntu Qt 5.6.1 and KDE Neon, Qt 5.7
      OpenSUSE Tumbleweed, Qt 5.12
    • Linux/X11
    • ba13c6c08f30a4c2f188f69deeaf4ca6a020d7a1 (qt/qtbase/5.12)

    Description

      Add a QLineEdit in a QToolbar, and enable the clear button of the lineedit.
      Now resize the window so that the lineedit is very small (see attached picture), CPU usage goes up to 11%.
      Sample code:

      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent)
      {
          QToolBar *toolb = new QToolBar(this);
          addToolBar(toolb);
          QLabel *lab = new QLabel("Sample text using space to easily resize lineedit");
          toolb->addWidget(lab);
          QLineEdit *srch = new QLineEdit(this);
          srch->setClearButtonEnabled(true);
          toolb->addWidget(srch);
      }
      

      Attachments

        1. lineedit-bug.png
          lineedit-bug.png
          49 kB
        2. qtbug54676.zip
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vitaly.fanaskov Vitaly Fanaskov
            jbm Jean-Baptiste Mardelle
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes