BTW, why doesn't the above code I tried to use work?
Because you are modifying an event which already has been executed.
For the modifier to have an effect you need to post an event which contains it.

If I will use the signal editTextChanged(QString), then it will capitalize everything,
You can add discrimination code in your slot to use Qstring::toUpper() only when you need it.