
Hi, just came across this blog post: http://scottcollins.net/blog/2005/09/question-for-other-boost-users.html It's from a person affiliated with Trolltech (makers of Qt), and raises a question how Boost.Signals and Qt can be made to better work together. Any user of both Boost and Qt cares to comment? - Volodya

Vladimir Prus wrote:
Hi, just came across this blog post:
http://scottcollins.net/blog/2005/09/question-for-other-boost-users.html
It's from a person affiliated with Trolltech (makers of Qt), and raises a question how Boost.Signals and Qt can be made to better work together.
Any user of both Boost and Qt cares to comment?
- Volodya
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
See Boost.Signals FAQ #3: 3. How do I get Boost.Signals to work with Qt? When building with Qt, the Moc keywords signals and slots are defined using preprocessor macros, causing programs using Boost.Signals and Qt together to fail to compile. Although this is a problem with Qt and not Boost.Signals, a user can use the two systems together by defining the BOOST_SIGNALS_NAMESPACE macro to some other identifier (e.g., signalslib) when building and using the Boost.Signals library. Then the namespace of the Boost.Signals library will be boost::BOOST_SIGNALS_NAMESPACE instead of boost::signals. To retain the original namespace name in translation units that do not interact with Qt, you can use a namespace alias: namespace boost { namespace signals = BOOST_SIGNALS_NAMESPACE; } http://www.boost.org/doc/html/signals/s04.html

Simon Buchan wrote:
Vladimir Prus wrote:
Hi, just came across this blog post:
http://scottcollins.net/blog/2005/09/question-for-other-boost-users.html
It's from a person affiliated with Trolltech (makers of Qt), and raises a question how Boost.Signals and Qt can be made to better work together.
See Boost.Signals FAQ #3:
3. How do I get Boost.Signals to work with Qt? When building with Qt, the Moc keywords signals and slots are defined using preprocessor macros, causing programs using Boost.Signals and Qt together to fail to compile.
Note that the author of the blog post explicitly mentions this FAQ item. Did you read the post at all? - Volodya

Vladimir Prus wrote:
Simon Buchan wrote:
Vladimir Prus wrote:
Hi, just came across this blog post:
http://scottcollins.net/blog/2005/09/question-for-other-boost-users.html
It's from a person affiliated with Trolltech (makers of Qt), and raises a question how Boost.Signals and Qt can be made to better work together.
See Boost.Signals FAQ #3:
3. How do I get Boost.Signals to work with Qt? When building with Qt, the Moc keywords signals and slots are defined using preprocessor macros, causing programs using Boost.Signals and Qt together to fail to compile.
Note that the author of the blog post explicitly mentions this FAQ item. Did you read the post at all?
- Volodya
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Actually, he mentions a sentence inside the FAQ, and seems to ignore the rest of it. Did you notice that the FAQ Item was explicitly about working with Qt? And that the library is carefully designed to not be clobbered by the Qt preprocceser? (signals is only used for the namespace name, and slot(s) is never used, only slot_type). Simply put '#define BOOST_SIGNALS_NAMESPACE whatever' before '#include <boost/signal.hpp>' and everything works nicely.

Simon Buchan wrote: [ snip 34 quoted lines, of which only 2 are important]
Note that the author of the blog post explicitly mentions this FAQ item. Did you read the post at all?
Actually, he mentions a sentence inside the FAQ, and seems to ignore the rest of it. Did you notice that the FAQ Item was explicitly about working with Qt? And that the library is carefully designed to not be clobbered by the Qt preprocceser? (signals is only used for the namespace name, and slot(s) is never used, only slot_type). Simply put '#define BOOST_SIGNALS_NAMESPACE whatever' before '#include <boost/signal.hpp>' and everything works nicely.
I would not call this "nicely", that's more "klugely". What if I happen to write a library which used boost::signals in headers? Do you suggest me to use class My { public: boost::BOOST_SIGNALS_NAMESPACE::signal<.....> on_whatever; }; ? Do you mean that the current situation is optimal, and any attempts on improving it are just wasting time? - Volodya

Vladimir Prus wrote:
Simon Buchan wrote:
[ snip 34 quoted lines, of which only 2 are important]
Note that the author of the blog post explicitly mentions this FAQ item. Did you read the post at all?
Actually, he mentions a sentence inside the FAQ, and seems to ignore the rest of it. Did you notice that the FAQ Item was explicitly about working with Qt? And that the library is carefully designed to not be clobbered by the Qt preprocceser? (signals is only used for the namespace name, and slot(s) is never used, only slot_type). Simply put '#define BOOST_SIGNALS_NAMESPACE whatever' before '#include <boost/signal.hpp>' and everything works nicely.
I would not call this "nicely", that's more "klugely". What if I happen to write a library which used boost::signals in headers? Do you suggest me to use
class My { public: boost::BOOST_SIGNALS_NAMESPACE::signal<.....> on_whatever; };
? Do you mean that the current situation is optimal, and any attempts on improving it are just wasting time?
- Volodya
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Are you serious? You're writing a library! You think someone might use it with Qt! Yes, dumbass, you SHOULD do that! Take a look at some of the boost headers (esp. functional, lambda, bind) and THEN bitch about how hard it is to write a library. If it hurts your poor fingers (or eyes), put this somewhere useful (ie. detail namespace): namespace whatever = ::boost::BOOST_SIGNALS_NAMESPACE;

Simon Buchan <simon <at> hand-multimedia.co.nz> writes:
Are you serious? You're writing a library!
I don't see how it differs from Qt's business (they write a library, too!) except probably that writing for boost is a hobby rather then a business. Try to look at boost from Qt's point of view and take into account that boost is closer to the C++ committee then Qt. -- Alexander Nasonov

Are you serious? You're writing a library! You think someone might use it with Qt! Yes, dumbass, you SHOULD do that! Take a look at some of the boost headers (esp. functional, lambda, bind) and THEN bitch about how hard it is to write a library. If it hurts your poor fingers (or eyes), put this somewhere useful (ie. detail namespace): namespace whatever = ::boost::BOOST_SIGNALS_NAMESPACE;
Simon, your reply and use of language is way out of order, as is your habit of excessively quoting all of the message including signatures and other completely irrelevant chaff. Please take a look at our posting guidelines (http://www.boost.org/more/discussion_policy.htm) and adjust your behaviour accordingly. With Boost Moderator Hat On, Yours, John Maddock.

<snip>
Simon, your reply and use of language is way out of order, as is your habit of excessively quoting all of the message including signatures and other completely irrelevant chaff. Yes. Again, sorry, I got a bit too angry, hitting reply right after each message (which, with auto-quoting, explains the other issue) But is a 2 line sig really that bad? Please take a look at our posting guidelines (http://www.boost.org/more/discussion_policy.htm) and adjust your behaviour accordingly. <snip> Will do.
participants (4)
-
Alexander Nasonov
-
John Maddock
-
Simon Buchan
-
Vladimir Prus