Project

General

Profile

Slots Macro: an opinion

Added by Ted Smith almost 15 years 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 (3)

RE: Slots Macro: an opinion - Added by Ted Smith almost 15 years ago

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

RE: Slots Macro: an opinion - Added by Ted Smith almost 15 years ago

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

RE: Slots Macro: an opinion - Added by Wim Dumon almost 15 years 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.

    (1-3/3)