What is the mistake in this code
can you geeks can tell me the solution for this,
i have a listview, when i tap on any item,a pop-up list should appear, after that based on the selected item from pop-up list i will update my UI.
i have written a code to get the popup list after tapping on any item from my view.
my problem is once i tap on any item, will get a popup list and i will also be able to select the item from popup list. once i press Ok in popup list i will ge a list with combo box also, i dont no what is wrong.. here is my code to get the popup list, please assist me where i am wrong
void myPopupWindow::Popupdialog()
{
QInputDialog input开发者_StackOverflowdialog;
QStringList items;
items << tr("Spring") << tr("Summer");
// bool val = QObject::connect(inputdialog,SIGNAL(textValueChanged(const QString &text)),this,SLOT(selText( const QString & text )));
bool val = QObject::connect(&inputdialog,SIGNAL(textValueChanged(const QString &)),this,SLOT(selText(const QString &)));
bool ok;
inputdialog.setOptions(QInputDialog::UseListViewForComboBoxItems);
inputdialog.setComboBoxItems(items);
inputdialog.exec();
QString item = inputdialog.getItem(this, tr("QInputDialog::getItem()"),tr("Season:"), items, 0, false, &ok);
}
i found answer, i need to remove this line from my above source code
QString item = inputdialog.getItem(this, tr("QInputDialog::getItem()"),tr("Season:"), items, 0, false, &ok);
精彩评论