You cannot apply validators to qtextedit. Try listening to textChanged signals and changing the text there... or install an event filter (but do not forget clopboard operations)