[Development] Namespace macros for Qt Add-Ons

henry.haverinen at nokia.com henry.haverinen at nokia.com
Fri Dec 9 11:20:07 CET 2011


On 12/9/11 10:50 AM, "Knoll Lars (Nokia-MP-Qt/Oslo)"
<lars.knoll at nokia.com> wrote:

>On 12/9/11 8:42 AM, "Haverinen Henry (Nokia-MP-Qt/Tampere)"
><henry.haverinen at nokia.com> wrote:


>>Now we have macros like:
>>
>>QTORGANIZER_USE_NAMESPACE
>>QTBLUETOOTH_USE_NAMESPACE
>>Q_USE_JSONDB_NAMESPACE
>>
>>So it's not consistent at the moment, which makes the macros
>>non-guessable. What would be the right thing to do here?
>
>I'm not a too big fan of these macros. The main question is whether they
>are needed at all.
>
>It doesn't really save any effort in typing. 'using namespace
>QtAddOn::JsonDb' is not really harder to type than the macro.

The current recommendation 'using namespace QtJsonDb' looks even better
and easier to understand :)

>And if we change to a different namespace it's most likely for a reason,
>and we would likely do some API changes in the process breaking SC. In
>that case it might be just as ok if developers have to manually change the
>using statement. At least everybody understands then that something has
>changed.

We should then make sure that the documentation and examples use normal
C++ using statements rather than any macros.

Best regards,
Henry




More information about the Development mailing list