[odb-users] bug with Qt 5.2.0-beta

Per Edin info at peredin.com
Mon Nov 25 07:02:27 EST 2013


Hi Abbas,

Although it may be possible to #include <QString>, I think it's best
to stick with Qt Coding Conventions, which is to always do #include
<Module/Whatever>.

See http://qt-project.org/wiki/Coding-Conventions#32bc73e08b315a2d85bfd10b2e8c867a

/Per

On Mon, Nov 25, 2013 at 12:15 PM, abbas ali chezgi <chezgi at yahoo.com> wrote:
> thanks Boris,problem solved.
> it seems that odb only needs QtCore
> is there any need to use module based includes?
> we can refactor Qt includes to simple case:
>   QtCore/QString ---> QString
>
> thanks.
>
>
>
>
> On Monday, November 25, 2013 1:05 PM, Boris Kolpackov <boris at codesynthesis.com> wrote:
>
> Hi,
>
> abbas ali chezgi <chezgi at yahoo.com> writes:
>
>> odb -I/home/abbas/Qt5.2.0/5.2.0-beta1/gcc/include/QtCore
>
> ODB includes Qt headers with the QtCore prefix, for example:
>
> #include <QtCore/QString>
>
> As a result, you need to also specify the "top-level" include
> directory for Qt with the -I option:
>
> odb -I/home/abbas/Qt5.2.0/5.2.0-beta1/gcc/include -I/home/abbas/Qt5.2.0/5.2.0-beta1/gcc/include/QtCore
>
> What most likely happens now is you get some headers from your
> Qt 5.2.0 beta and some from your default Qt installation. Not
> a good thing.
>
> If this help with the ODB compilation, I suggest that you also
> make sure that libodb-qt is built with both include directories.
>
> If this doesn't help, try to compile this test with g++ and see
> if you can make it work with Qt 5.2.0:
>
> #include <QObject>
> #include <QString>
> #include <QVariant>
> int main () {}
>
>
> Boris



More information about the odb-users mailing list