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

QCompleter should respect minimumSize of the popup widget on Mac

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • 4.5.0
    • 4.4.1
    • None
    • macOS

    Description

      A minimum size set for the popup that is used with a QCompleter will
      not be respected. The widget will have the same width as lineEdit, regardless of the minimumSize constraints.

      The documentation for QWidget::minimumSize states that widgets will
      never become smaller than minimumSize allows..

      #include <QtGui>

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

      QDialog d;
      QVBoxLayout *l = new QVBoxLayout(&d);
      QLineEdit *le = new QLineEdit;
      l->addWidget(le);

      QStringListModel *slm = new QStringListModel;
      slm->setStringList(QStringList() << "one (more text that should be visible for this example)" << "two" << "three");

      QCompleter *c = new QCompleter;
      c->popup()->setMinimumSize(QSize(250, 50));
      c->setModel(slm);
      le->setText("please type 'one'");
      le->selectAll();
      le->setCompleter(c);

      d.resize(QSize(200, 40));
      d.show();

      return app.exec();
      }

      Attachments

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

        Activity

          People

            menard Alexis Menard (closed Nokia identity) (Inactive)
            dettman Dean Dettman (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes