Object::connect: No such slot QWidget::
出现如下错误
Object::connect: No such slot QWidget::readMyCom() in ../untitled/ConversionScreen.cpp:49
解决办法
加入Q_OBJECT
。使当前类具有信号槽的能力
class ConversionScreen : public QWidget
{
Q_OBJECT
public:
explicit ConversionScreen(QWidget *parent = 0);
~ConversionScreen();
private slots:
void on_pushButton_clicked();
void readMyCom();
};