[Development] Container refactor update
Thiago Macieira
thiago.macieira at intel.com
Tue Jun 19 11:28:40 CEST 2012
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120619/8968e3f0/attachment.sig>
More information about the Development
mailing list