我有这堂课:
class CustomEdit : public QTextEdit
{
Q_GADGET
public:
CustomEdit(QWidget* parent);
public slots:
void onTextChanged ();
};
CustomEdit::CustomEdit(QWidget* parent)
: QTextEdit(parent)
{
connect( this, SIGNAL(textChanged()), this, SLOT(onTextChanged()));
}
void CustomEdit::onTextChanged ()
{
// ... do stuff
}
onTextChanged
当我在编辑控件中键入文本时,永远不会调用该方法。
我错过了什么?