Slots Macro: an opinion

Added by Ted Smith over 1 year ago

I am new to Wt, and I do not have a background in Qt. Perhaps because of this, I was confused by the line, "private slots:" which can be found in the examples. The first thing I did was to check around to see if C++ had changed. It hadn't. After some searching, I found inside the Wt include file named WObject, the empty macro named "slots."

In my opinion, it is a bad practice to alter the underlying language with macros. If it must be done for some reason, I suggest using some name like, SLOTS_MACRO, to give readers a clue about its nature.


Replies

RE: Slots Macro: an opinion - Added by Ted Smith over 1 year ago

The macro, SLOT defined in WSignal as "x, &y", also seems strange. Why is SLOT needed?

RE: Slots Macro: an opinion - Added by Ted Smith over 1 year ago

The macro, SLOT defined in WSignal as "x, &y", also seems strange. Why is SLOT needed?

RE: Slots Macro: an opinion - Added by Wim Dumon over 1 year ago

SLOT(a,b) is not needed at all. It is there to make people who come from Qt to feel more at home.

The 'slots' macro is there for the same reason, and we hardly use it. I suggest you ignore it.

BR,
Wim.