Search code examples
c++qtqt4signals-slotsqt4.7

Signals and Slots in Qt4


I'm trying to create a signal and slot in Qt4 and I am fairly new to Qt. From what I understand in Qt5 it is just created automatically and this is not the case in Qt4 it seems. I'm trying to create a an action when the user clicks on an option in the menu bar at the to of the UI.= I see that there is a Signal/Slot editor at the bottom of the screen with options "Sender", "Signal", "Receiver", and "Slot". I'm not entirely sure how to use this function. Any help is appreciated.


Solution

  • Basically you need to connect your signal and slot

    connect(ui->button1, SIGNAL(clicked()), this, SLOT(yourSlot()));
    

    and in this link there is good example about signals and slot: signals and slots in qt.