On terça-feira, 19 de junho de 2012 10.22.02, Peter Kümmel wrote:
> > Moc can understand template code just fine for the output it produces. The
> > problem is that the meta object format does not allow for signals and
> > slots
> > containing template parameters in their signature.
>
> But moc could not produce code like this, so I would say it is not "just
> fine":

Let me emphasise what I said: it can read code just fine for the uses that it
makes. It can parse templates up to an extent. It does not parse what it
cannot use anyway.

> - header:
>
> template<class T>
> struct A : public QObject
> {
> signals:
>      void aSignal(T);
>
> public:
>    void foo(){...}
> };
>
> - somewhere:
> A<int> a;
>
>
> - moc file/header:
>
> template<>
> struct A<int> : public QObject
> {
>      Q_QOBJECT
>
> signals:
>      void aSignal(int);
>
>      // simple copy of code in base template
>      void foo(){...}
> };
>
>   + the typical moc code
>
>
>
> But for this all source code needs to be scanned,
> not only the headers.

Or you need to tell moc which instantiations to produce.

Since there is no way of doing that right now, moc cannot instantiate anything
for you. Then we go back to my assertion that moc works fine for the output
that it *can* produce. :-)

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to