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

Typing in editable combobox with many entries is very slow when completer is used

XMLWordPrintable

      In the following example, each keystroke in the lineedit takes about 600ms before the UI reacts. Using QCompleter::PopupCompletion is much faster, as there are viewer items that the view has to layout.

      #include <QtGui>

      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);

      QStringList items;
      for (int i = 1; i < 9999; ++i)
      items << QString("%1").arg;

      QWidget widget;
      QComboBox combo;
      combo.setEditable(true);
      combo.setInsertPolicy(QComboBox::NoInsert);
      combo.completer()->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
      combo.addItems(items);

      QHBoxLayout* hbox= new QHBoxLayout(&widget);
      hbox->addWidget(&combo);

      widget.show();
      return app.exec();
      }

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

            bjnilsen Bjørn Erik Nilsen
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes