Qt5 中 如何 connect 类自身的某个 slots
代码大致是这样
.h
class RecordBox : public QWidget
{
Q_OBJECT
public:
explicit RecordBox(QWidget *parent = 0);
public slots:
void Changed();
private:
QTextEdit *textEdit;
};
RecordBox::RecordBox(QWidget *parent) :
QWidget(parent)
{
//label = new QLabel;
textEdit = new QTextEdit;
connect( textEdit, &QTextEdit::textChanged, this, &RecordBox::Changed ); //error
}
connect( textEdit, &QTextEdit::textChanged, this, &RecordBox::Changed ); //error