Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

why show Popup function of comboBox is not working?



  • hii i am new to qt and just experimenting with some functions of comboBox.
    i have written the following code
    ui->comboBox->addItem("mark");
    ui->comboBox->count();
    ui->showPopup();
    in main window() of project
    this code has added mark to the comboBox if i write the following code

    ui->comboBox->addItem("mark");

    but count() and showPopup() are not working and following error is coming.
    class Ui::MainWindow has no member named show Popup.



  • count() just return the number of items as the result, what do you expect it to work?
    showPopup() should be called on the combo box, so ui->comboBox->showPopup().
    Are you also new to C++? Feels like you need learn some basics first.


Log in to reply