|
Boost-Commit : |
From: dgregor_at_[hidden]
Date: 2008-01-14 12:11:33
Author: dgregor
Date: 2008-01-14 12:11:33 EST (Mon, 14 Jan 2008)
New Revision: 42768
URL: http://svn.boost.org/trac/boost/changeset/42768
Log:
Merge documentation improvement to the Signals lib, from Niels Dekker
Text files modified:
branches/release/libs/signals/doc/faq.xml | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
Modified: branches/release/libs/signals/doc/faq.xml
==============================================================================
--- branches/release/libs/signals/doc/faq.xml (original)
+++ branches/release/libs/signals/doc/faq.xml 2008-01-14 12:11:33 EST (Mon, 14 Jan 2008)
@@ -86,23 +86,39 @@
}
</programlisting>
- <para>The second way, provided by Frank Hess, involves
+ <para>The second way, provided by Frank Hess and improved by
+ Niels Dekker, involves
creating a header <code>signalslib.hpp</code> that contains
the following code:</para>
- <programlisting>#ifdef signals
-#error "signalslib.hpp must be included before any qt header"
+ <programlisting>#ifndef SIGNALSLIB_HPP_INCLUDED
+#define SIGNALSLIB_HPP_INCLUDED
+
+#if defined(signals) && defined(QOBJECTDEFS_H) && \
+ !defined(QT_MOC_CPP)
+# undef signals
+# define signals signals
#endif
#include <boost/signal.hpp>
namespace boost
{
namespace signalslib = signals;
-}</programlisting>
+}
+
+#if defined(signals) && defined(QOBJECTDEFS_H) && \
+ !defined(QT_MOC_CPP)
+# undef signals
+// Restore the macro definition of "signals", as it was
+// defined by Qt's <qobjectdefs.h>.
+# define signals protected
+#endif
+
+#endif</programlisting>
- <para>This header must be included before any Qt headers. Once
- it has been included, you can refer to the Signals library via
- the namespace <code>boost::signalslib</code>. This option is
+ <para>Use this header to include the Boost library, then refer
+ to it in the namespace <code>boost::signalslib</code>. This
+ option is often
preferable to the first option because it can be used without
recompiling the Signals library binary. </para>
</answer>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk