Signals and Public Slots Blocks

Question:
Everybody knows the meaning of public, private, and protected blocks in a class interface. While browsing through a KDE program I found two other block types: signals and public slots. What do they mean? Is this a special thing of Qt? If so, how do they make it possible?

Answer:
Qt isn’t C++, but a variant dialect called “moc” that defines three new keywords: signals, slots, and emit. Explaining the semantics and usage of these non-standard keywords is beyond the scope of this forum, but essentially, they are used in firing and handling events, and relating these events to a particular class and method. The Qt framework contains special header files to implement these extensions using the preprocessor.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts