^NyAw^
31st March 2008, 09:49
Hi,
I have this code on "on_TextComboBox_textChanged(const QString &qText)" slot
ui.TextComboBox->setCompleter(0);
ui.TextComboBox->setEditable(false); //To not let the combo emit "textChanged"
ui.TextComboBox->clear();
//Fill the combo with the list elements
if (!qLList.isEmpty())
for (int i = 0; i < qLList.size(); ++i)
ui.TextComboBox->addItem(QObject::tr(qLList.at(i).toAscii().data()) );
//Adding the text written by hand on the combo
ui.TextComboBox->addItem(qText);
if (m_pCParameter->isEditable())
ui.TextComboBox->setEditable(true);
It crashes when exits the slot on "QCompleter::completionMode()" function.
What I want is a Combo that contains some items and the combo also have to be editable. So, when the user starts writting I want to insert the text as an item. For doing this I clear the items, add the items and finally add the text written as item. I don't want the completer so I try to disable it calling "ui.TextComboBox->setCompleter(0);".
Thanks,
I have this code on "on_TextComboBox_textChanged(const QString &qText)" slot
ui.TextComboBox->setCompleter(0);
ui.TextComboBox->setEditable(false); //To not let the combo emit "textChanged"
ui.TextComboBox->clear();
//Fill the combo with the list elements
if (!qLList.isEmpty())
for (int i = 0; i < qLList.size(); ++i)
ui.TextComboBox->addItem(QObject::tr(qLList.at(i).toAscii().data()) );
//Adding the text written by hand on the combo
ui.TextComboBox->addItem(qText);
if (m_pCParameter->isEditable())
ui.TextComboBox->setEditable(true);
It crashes when exits the slot on "QCompleter::completionMode()" function.
What I want is a Combo that contains some items and the combo also have to be editable. So, when the user starts writting I want to insert the text as an item. For doing this I clear the items, add the items and finally add the text written as item. I don't want the completer so I try to disable it calling "ui.TextComboBox->setCompleter(0);".
Thanks,