Basically, sender() returns a QObject*, so you will not be able to call methods of the underlying object until it is downcasted.

qobject_cast performs the downcast, while checking at runtime the underlying object is effectively of the required type. This is similar to standard dynamic_cast, except it has a reduced cost due to Qt's meta-object facilities (but it only works with classes derived from QObject).