@JuanNunez I deleted my first response as I did not realised that it was about a signal and one does not have to implement a signal.
Did you try a complete rebuild after adding signal? Delete build folder, run qmake and build.
@Corvette653 said in difference between connect functions:
"There is no automatic disconnection when the 'receiver' is destroyed because it's a functor with no QObject."
That refers to the 3 arguments version of connect. Take this example: connect(lineEdit,&QLineEdit::textChanged,[label](const QString& text){label->setText(text);});
if you call delete label; Qt can't know it should not execute the slot anymore and will crash when trying to call label->setText. As mentioned in the docs, in the following phrase, the solution is to add label as a context argument (connect(lineEdit,&QLineEdit::textChanged,label,[label](const QString& text){label->setText(text);});) so that Qt knows that when label is destroyed it should not execute the slot anymore
The problem was that my class inherited QGraphicsItem, not QObject, but I found another way to do what I wanted. From now on, I will use the new syntax. Thank you!
@hobbyProgrammer said in window closes after completing certain actions.:
@JonB Hi, just a quick update. I think it does get there, but it prints this part before going executing the slot.
It's really important for those who try to help you to give accurate description of what does/does not happen. Everyone was trying to figure how your connect() could not complete and get to the next line....
as it already suggested by other in the group, please go through signals/slots. Try few examples with how signals/slots work. This should give good info to achieve your use case.