[Qt-interest] [ANN] ODB C++ ORM adds support for Qt

Konstantin Tokarev annulen at yandex.ru
Fri Apr 29 12:03:23 CEST 2011



29.04.2011, 13:23, "Boris Kolpackov" <boris at codesynthesis.com>:
> Hi Konstantin,
>
> Konstantin Tokarev <annulen at yandex.ru>; writes:
>
>>  Actually, they are - all their declarations are wrapped into macros
>>  QT_BEGIN_NAMESPACE and QT_END_NAMESPACE, namespace name
>>  is configurable.
>
> I saw those and was wondering if this is in preparation to move to
> namespace'd Qt. Are there plans to turn them on by default in some
> future release?

It is not a preparation - there's a configure parameter  -qtnamespace <name>

I don't know anything about such plans but I'm sure it won't happen in 4.x series -
too many external projects will be broken

>
>>  Also, nothing prevents you from using your own namespace for your code
>>  even when Qt is compiled without namespace support.
>
> Agree. Our goal with lazy pointers was to "blend in" as much as
> possible with the default Qt configuration. But perhaps we should
> also add QT_BEGIN_NAMESPACE and QT_END_NAMESPACE. Or perhaps even
> do something like this to allow the user to put lazy pointers to a
> different namespace:
>
> if defined(ODB_QT_BEGIN_NAMESPACE)
> ODB_QT_BEGIN_NAMESPACE
> elif defined(QT_BEGIN_NAMESPACE)
> QT_BEGIN_NAMESPACE
> endif
>
> // Lazy pointer code.
>
> if defined(ODB_QT_END_NAMESPACE)
> ODB_QT_END_NAMESPACE
> elif defined(QT_END_NAMESPACE)
> QT_END_NAMESPACE
> endif
>

I don't think it's a good style to do such tricks. It's better to place your code in your
own namespace. User always will be able to add scope operator :: or using.
Also, there will be no trouble if someday one adds class "QLazySharedPointer" to Qt.

-- 
Regards,
Konstantin



More information about the Qt-interest-old mailing list