views:

106

answers:

1

Hey,

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 inputdialog;
      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);


    }
+2  A: 

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);
Shadow
@Shadow Good job! You may collect the *Self-learner* badge.)
mosg
@ Shadow, Nothing will teach you better than your own debugging.. :)
liaK