Alex Rivera | Logout

How to process signals in a Qt subclass?

Asked 2010-06-09T07:41:15.840
12

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 seems silly to connect an object to itself, I should be able to simply override the textChange method -- but it isn't virtual.

What is the accepted way to do this?

Edit
Report

1 Answer

12

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)) );
answered 2010-06-09T11:34:03.600

Your Answer