PDA

View Full Version : QCompleter + QPllainTextEdit



Fallen_
9th April 2011, 20:24
Hey, the title says it all, my current code doesnt work:

completer = new Completer(this);
static QStringList completerList = completer->loadFromFile(QDir::currentPath() + "/data/completer.xml");
if (!completerList.size())
{
int ret = QMessageBox::information(this, tr("Warning"), tr("Could not load completer list, would you like to continue?"), QMessageBox::Ok | QMessageBox::Cancel);
if (ret == QMessageBox::Cancel)
qApp->quit();
}
else
{
QStringListModel *model = new QStringListModel(this);
model->setStringList(completerList);
completer->setModel(model);
}

completer->setWidget(this);
any ideas?