Details
-
Bug
-
Resolution: Cannot Reproduce
-
P3: Somewhat important
-
4.4.1
-
None
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();
}