How to process signals in a Qt subclass?

前端 未结 3 1696
生来不讨喜
生来不讨喜 2021-01-11 17:17

How do I process a signal of in a subclass? Let\'s say my subclass is derived from QTextEdit and is interested in the signal textChanged. It seem

3条回答
  •  轮回少年
    2021-01-11 17:37

    You can't implement/override a signal, so the only way is to create a new slot and connect it to textChanged():

    connect( this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)) );
    

提交回复
热议问题