Re: New to aap: misc. problems

Rainer Michael Schmid <[email protected]> Tue, 6 Jul 2004 17:30:48 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
>> - The add_LIBS option passes the arguments (as it seems) directly. 
>> This
>
> Aap is still evolving, don't forget that. It's not been used on every
> possible platform yet.

Ok, that was one of the things I wanted to know. On the website it was 
not clear what the status is.

>> - I took a look at the source code of the Qt module and it seems that 
>> a
>> lot of special things are hardcoded (I haven't tried it yet, but that
>> will come soon). E.g. the default for the directory of the Qt
>> installation is /usr/local/qt-3.2 (i.e. even ther version is hardcoded
>
> The Qt stuff is mine, and since there is _no_ standard place to look 
> for
> Qt (well, I could have chosen /usr/X11R6), this is what you get. 
> Patches
> are welcome, of course (to this list) with an exhaustive search of all 
> the
> possible default places it could be.

That is true. But it might be that the moc and uic tools are already in 
the path and that the headers are in a standard-include, e.g.

As I said, I haven't used the Qt module yet. But I will send patches if 
I start using it (and I will probably start using it soon).

>> The handling of the moc is also done in a
>> non-standard way that can cause problems.
>
> How so?

 From my understanding of the Qt module, from the header file a .moc 
file is generated. The .cpp file generated from the .ui file includes 
that .moc file (by modifying the generated file). It doesn't seem that 
the module scans for the Q_OBJECT macro. So I am not sure if the module 
can handle subclasses of QObjects correctly (only if it is done in a 
.ui file).

The standard Qt way of handling the moc is:

1. Scan the .h files for the Q_OBJECT macro. If it is found, tell moc 
to generate a file moc_<filename>.cpp which is compiled and linked as 
any .cpp file.

2. Scan the .cpp files for the Q_OBJECT macro. If it is found, tell moc 
to generate a file <filename>.moc. That file is included in the .cpp 
file by the user.

3. For the .ui files, tell the moc to genrate a file moc_<filename>.cpp 
which is compiled and linkes as any .cpp file (I am not sure if this is 
needed for every .ui file).

This approach has the advantage that no files need to be modified by 
aap. Furthermore, it is possible that you can have QObject subclasses 
in both, the header and the .cpp file.

When I come to the point needing this, I will take a look and try to 
change the Qt module. I will post my changes to the list.

Rainer



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com