You shouldn't really be using sender() and that ugly type casting. Use QSignalMapper instead.