Boost signals & slots with Qt

Published Friday June 15th, 2007
1 Comment on Boost signals & slots with Qt
Posted in Qt

The problem in brief: Trolltech invented signals & slots, Boost implemented the concept using plain templates, and ironically you couldn’t easily combine both libraries because of a relatively simple name clash. Trolltech used macro keywords and Boost loved our naming so much that they picked the same terms => clash. Off topic, I like that they took our naming, it’s a bit of a pity recent implementations done by other parties call the very same concept events and delegates.

Anyway, with “CONFIG += no_keywords” we have solved the name clash in Qt 4.1, released in December 2005.

Scott Collins now let me know, that the May update of the Boost libraries has an updated Boost.Signals FAQ with respect to Qt that describes the technique. Have a look at http://boost.org/doc/html/signals/s04.html. It explains how to use Boost signals & slots in Qt applications, and also references Scott’s own article, “A Deeper Look at Signals and Slots”.

Update Monday, 30 June 2008: The links appear to be dead by now. No alternative links known to me, sorry, but way back can help: http://web.archive.org/web/20070703100120/http://scottcollins.net/articles/a-deeper-look-at-signals-and-slots.html

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Qt

One comment

jamadagni says:

Hello. The boost.signals FAQ which you point to says that it is possible to switch off the Qt keywords on a per-project or per-file basis. While per-project is right, I don’t understand how it is possible to switch it off for a single file unless that single file is in a separate folder with a separate pro file, or… I’m confused. Please tell me how it is possible to do for per-file?

Thanks.

Commenting closed.

Get started today with Qt Download now