[Interest] Is QMetaMethod::tag() functional?

Immanuel Weber immanuel.weber at gmail.com
Wed Mar 6 11:24:12 CET 2013


Ahhh, thank you! It works now. That enclosing #infdef should definitely be
stated in the documentation. If I have some spare time, I will have a look
at the documentation contribution process.



2013/3/5 Thiago Macieira <thiago.macieira at intel.com>

> On terça-feira, 5 de março de 2013 21.14.32, Immanuel Weber wrote:
> > Mhh, then I must be doing something wrong, here is my code example:
>
> > #ifndef TAGCLASS_H
> > #define TAGCLASS_H
> >
> > #include <QObject>
> > #define MYTAG // bla bla
>
> This is the issue. In Qt 5, moc expands macros, so it must not see the
> expansion.
>
> Take qdbusmacros.h:
>
> #ifndef Q_MOC_RUN
> # define Q_NOREPLY
> #endif
>
>
> > That should, as far as I understand, print the name and the tag of each
> > invokable function of TagClass, but on my system (Win7x64 + Qt5.0.1x86)
> no
> > tag is being printed for testFunc() :(
>
> Yup. Take this source code, for example (it doesn't #include anything, it's
> just for testing):
>
> #define Q_NOREPLY
> class MyObject: public QObject {
> Q_OBJECT
> public slots:
>     Q_NOREPLY void foo();
> };
>
> When processed with qdbuscpp2xml from Qt 4.8, it prints:
>     <method name="foo">
>       <annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
>     </method>
>
> When processed with Qt 5, it prints:
>     <method name="foo">
>     </method>
>
> It goes back to the original behaviour if I remove the #define line.
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130306/1498f864/attachment.html>


More information about the Interest mailing list