Solved QComboBox signal and slot connection problems
-
I am developing an application for testing students and I have a problem connecting a signal from a QComboBox to my slot. I tried to use the new connect-function syntax but nothing works:
connect(gradeBox, &QComboBox::activated(QString), this, &HomeWindow::printGrade(QString));
this causes a lot of errors, homewindow.cpp line 60 is line with "connect":
I tried to use various options for recording a parameter in a signal and slot as "const QString" , "QString&" or "const QString&" but this isn't working anyway. I readed Qt Documentation but don't find answer. What am I doing wrong? -
Hi
Its due to it being overloaded so there is an INT version and STRING versiontry
connect(comboBox, QOverload<QString>::of(&QComboBox::activated), this, &HomeWindow::printGrade); -
@Yosei said in QComboBox signal and slot connection problems:
connect(gradeBox, &QComboBox::activated(QString), this, &HomeWindow::printGrade(QString));
connect(gradeBox, &QComboBox::activated, this, &HomeWindow::printGrade);
-
Hi
Its due to it being overloaded so there is an INT version and STRING versiontry
connect(comboBox, QOverload<QString>::of(&QComboBox::activated), this, &HomeWindow::printGrade);