QT signal and slot function

This document explains that signals should have a void as a return value, but what about slots? Since the signals should not return anything, can I assume that it is the same for the slots?

+3
source share
1 answer

Your slots can return a value.

However, if the slot is connected to the signal and called when the signal is issued, the return value will be ignored.

But the slot is a normal member function and can be called like any other function. In this case, the return value can be used by the caller.

This is indicated in the document you are referencing:

-, ++ .

+11

Source: https://habr.com/ru/post/1779363/


All Articles