You can't have multiple inheritance from QObject, so that won't do. You could have a subclass of QPushButton where you would pass a painter pointer through a constructor. But it could be dangerous and error prone.