Search code examples
qtsignals-slots

how to inherit a Qpushbutton signal


i passed an argument to a Qt Slot , the argument is a class that i have wroted ( Image_Viewer ).

to make connection betwen a signals and a slots , they both have to had the same type of argument ( correct me if i am wrong ).

i only need the clicked() signal of the Qpushbutton classe but since it has not the same argument of the Slot i have wroted , the connection cant be done.

if making another signal that also have (Image_Viewer) as an argument is the ONLY SOLUTION , then how and where can i wrote it ? and if it isnt then what is the solution ?

PS : Sorry for my english


Solution

  • You could use a QSignalMapper to simulate "adding" a parameter to the clicked() slot. The example in the docs do just that.

    More information in the Signals and Slots - Advanced Usage section.