I can reproduce this error on my installation. It seems that setCompletionColumn() doesn't set a proper model column on the popup. A solution is to call:
((QListView*)cc
->popup
())->setModelColumn
(2);
((QListView*)cc->popup())->setModelColumn(2);
To copy to clipboard, switch view to plain text mode
The funny thing is, that it should work without it just fine...
This is the code that gets called:
{
if (d->column == column)
return;
#ifndef QT_NO_LISTVIEW
if (QListView *listView
= qobject_cast<QListView
*>
(d
->popup
)) listView->setModelColumn(column);
#endif
d->column = column;
d->proxy->invalidate();
}
void QCompleter::setCompletionColumn(int column)
{
Q_D(QCompleter);
if (d->column == column)
return;
#ifndef QT_NO_LISTVIEW
if (QListView *listView = qobject_cast<QListView *>(d->popup))
listView->setModelColumn(column);
#endif
d->column = column;
d->proxy->invalidate();
}
To copy to clipboard, switch view to plain text mode
So there are three explanations:
1. popup is not a QListView
2. d->column == column
3. QT_NO_LISTVIEW is defined
First two assumptions are false (popup is a list view and d->column != column) and the third seems very unlikely. So there has to be a fourth explanation - something overrides or doesn't allow to change the model column for the listview.
Bookmarks