I have this listWidget that displays a list of dogs (name - breed) . I have this comboBox that is supposed to let me choose between displaying short version (just name - breed) or detailed version (name - breed - age - weight - photograph). For some reason, my comboBox doesn't do anything, even if my connection doesn't give me any errors. This is how I implemented it:
QObject::connect(ui.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_comboBox_event(int)));
void QtGuiApplication::on_comboBox_event(int selection)
{
switch (selection) {
case 0:
this->populateDogsList();
break;
case 1:
this->populateDogsListDetailed();
break;
}
}
What am I doing wrong? Please do help me, I've looked everywhere :/ Thanks. PS. My populate list method works by itself, I can't even debug it since it doesn't enter the comboBox event method.
Class definition : (header) class QtGuiApplication : public QMainWindow { Q_OBJECT
public: QtGuiApplication(Controller& ctrl, QWidget *parent = Q_NULLPTR); ~QtGuiApplication() {};
(code)