The error message 'no matching function for call to 'connect(...)' suggests that there is no matching function for the connect call. This issue might be related to the connection syntax, specifically when using lambda functions directly. Instead of directly using a lambda function, define a slot in your class and connect it to the currentIndexChanged signal of the QComboBox. Here's an example:

// Define a slot in your class
void UsersWidget::on_modeComboBox_currentIndexChanged(const QString& mode) {
    // Your slot implementation
}

// Connect the signal to the slot
connect(ui->mode, QOverload<const QString&>::of(&QComboBox::currentIndexChanged), this, &UsersWidget::on_modeComboBox_currentIndexChanged);

Make sure to replace UsersWidget with the appropriate class name if you are using a different class.

Qt Connect Error: No Matching Function for 'connect' Call

原文地址: https://www.cveoy.top/t/topic/fA9J 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录