[Digikam-devel] C++ namespace issues

Gilles Caulier caulier.gilles at gmail.com
Mon Sep 1 14:13:08 BST 2008


2008/9/1 Marcel Wiesweg <marcel.wiesweg at gmx.de>

> Hi,
>
> I found out that some DBus communication from ioslave to main app is a bit
> broken (for db change notification). Debugging that, I have come to a point
> where I want to persuade moc to put the Digikam namespace in front of
> signal
> parameters. Easiest is to put it there in code as well, but does anyone
> know
> if this is legal C++ (or if it will be rejected by strict compilers on
> other
> platforms?):
>
> namespace Digikam
> {
>
> class MyClass : public QObject
> {
> Q_OBJECT
> signal:
>        void mySignal(const Digikam::MyDigikamObject &);
>        // I mean the extra "Digikam::" in the previous line
> };
>
> }
>
> Thanks
> Marcel
>

Marcel,

Using namespace X into a code wrapped with X namespace will generate an
error if the right option from gcc is enable, else it will be fine. I don't
know other compilers...

But in your case, this will not be a compiler problem, but a Qt moc
pre-compiler issue. unforget than signal and slots are formated to standard
C++ by moc before to be played by GCC. So, i think it will fine for us.

Best

Gilles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20080901/6c660d39/attachment.html>


More information about the Digikam-devel mailing list