Qt no matching function for call to XXX::connect(),函数重载问题

no matching function for call to XXX::connect()

问题

在mainwindow类中使用historydata类的信号,调用connect()函数

connect(historydata, &HistoryData::dataShow, [this](QString message){
    
    this->ui->pTE->moveCursor(QTextCursor::End);
                                                                         this->ui->pTE->insertPlainText(message);});

solving

Qt新添加的类,默认是custom的,没有QObject宏,无法使用connect函数特性
在这里插入图片描述

函数重载

函数名相同,但是参数是不同的

猜你喜欢

转载自blog.csdn.net/qq_43641765/article/details/115281200