diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-27 12:34:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-27 12:34:56 +0200 |
commit | e10e8aab78cd70edc606b475d7feca2f0845f780 (patch) | |
tree | 0f71ad0263db4d8f1dd22ce3d575a202c5c444ba | |
parent | 3b0c8f513fe83d279c17486c0e91adb35db0e07b (diff) |
Use QtCore prefix when including Qt headers1.4.0
This appears to be more portable. For example, on Mac OS X with
-framework QtCore option include <QString> does not work while
including <QtCore/QString> does.
24 files changed, 71 insertions, 38 deletions
diff --git a/m4/libqt.m4 b/m4/libqt.m4 index 2ab8272..bb7ffa5 100644 --- a/m4/libqt.m4 +++ b/m4/libqt.m4 @@ -20,7 +20,7 @@ AC_MSG_CHECKING([for QtCore]) CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include <string> -#include <QString> +#include <QtCore/QString> int main () @@ -44,7 +44,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include <string> -#include <QString> +#include <QtCore/QString> int main () @@ -63,6 +63,39 @@ libqt_found=yes fi fi +# Try framework in case we are on Mac OS X. +# +if test x"$libqt_found" = xno; then + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + + CPPFLAGS="$CPPFLAGS -framework QtCore" + LIBS="-framework QtCore $LIBS" + + CXX_LIBTOOL_LINK_IFELSE( +AC_LANG_SOURCE([[ +#include <string> +#include <QtCore/QString> + +int +main () +{ + QString qs ("test"); + std::string ss (qs.toStdString ()); + return ss.size () != 0; +} +]]), +[ +libqt_found=yes +]) + + if test x"$libqt_found" = xno; then + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + fi +fi + # If QtCore is not found, try its versioned variant, QtCore4. # if test x"$libqt_found" = xno; then @@ -73,7 +106,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include <string> -#include <QString> +#include <QtCore/QString> int main () @@ -111,7 +144,7 @@ if test x"$libqt_found" = xno; then CXX_LIBTOOL_LINK_IFELSE( AC_LANG_SOURCE([[ #include <string> -#include <QString> +#include <QtCore/QString> int main () diff --git a/odb/qt/basic/mysql/default-mapping.hxx b/odb/qt/basic/mysql/default-mapping.hxx index 8ffcafe..d111a08 100644 --- a/odb/qt/basic/mysql/default-mapping.hxx +++ b/odb/qt/basic/mysql/default-mapping.hxx @@ -6,8 +6,8 @@ #ifndef ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX #define ODB_QT_BASIC_MYSQL_DEFAULT_MAPPING_HXX -#include <QString> -#include <QByteArray> +#include <QtCore/QString> +#include <QtCore/QByteArray> // By default, map QString to MySQL TEXT for non-id and to VARCHAR(256) for // id members. MySQL cannot have primary keys of the TEXT type. diff --git a/odb/qt/basic/mysql/qbyte-array-traits.hxx b/odb/qt/basic/mysql/qbyte-array-traits.hxx index 0c1a5b8..52e620c 100644 --- a/odb/qt/basic/mysql/qbyte-array-traits.hxx +++ b/odb/qt/basic/mysql/qbyte-array-traits.hxx @@ -11,7 +11,7 @@ #include <cstring> // std::memcpy #include <cstddef> // std::size_t -#include <QByteArray> +#include <QtCore/QByteArray> #include <odb/details/buffer.hxx> #include <odb/mysql/traits.hxx> diff --git a/odb/qt/basic/mysql/qstring-traits.hxx b/odb/qt/basic/mysql/qstring-traits.hxx index 17f0946..922c4c3 100644 --- a/odb/qt/basic/mysql/qstring-traits.hxx +++ b/odb/qt/basic/mysql/qstring-traits.hxx @@ -11,7 +11,7 @@ #include <cstring> // std::memcpy #include <cstddef> // std::size_t -#include <QString> +#include <QtCore/QString> #include <odb/details/buffer.hxx> #include <odb/mysql/traits.hxx> diff --git a/odb/qt/basic/sqlite/default-mapping.hxx b/odb/qt/basic/sqlite/default-mapping.hxx index 7211700..cc04ddd 100644 --- a/odb/qt/basic/sqlite/default-mapping.hxx +++ b/odb/qt/basic/sqlite/default-mapping.hxx @@ -6,8 +6,8 @@ #ifndef ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX #define ODB_QT_BASIC_SQLITE_DEFAULT_MAPPING_HXX -#include <QString> -#include <QByteArray> +#include <QtCore/QString> +#include <QtCore/QByteArray> // Map QString to SQLite TEXT by default. Allow NULL values by default as // QString provides a null representation. diff --git a/odb/qt/basic/sqlite/qbyte-array-traits.hxx b/odb/qt/basic/sqlite/qbyte-array-traits.hxx index 0ab4835..0d1437e 100644 --- a/odb/qt/basic/sqlite/qbyte-array-traits.hxx +++ b/odb/qt/basic/sqlite/qbyte-array-traits.hxx @@ -11,7 +11,7 @@ #include <cstring> // std::memcpy #include <cstddef> // std::size_t -#include <QByteArray> +#include <QtCore/QByteArray> #include <odb/details/buffer.hxx> #include <odb/sqlite/traits.hxx> diff --git a/odb/qt/basic/sqlite/qstring-traits.hxx b/odb/qt/basic/sqlite/qstring-traits.hxx index 53c4be4..5014aaf 100644 --- a/odb/qt/basic/sqlite/qstring-traits.hxx +++ b/odb/qt/basic/sqlite/qstring-traits.hxx @@ -11,7 +11,7 @@ #include <cstring> // std::memcpy #include <cstddef> // std::size_t -#include <QString> +#include <QtCore/QString> #include <odb/details/buffer.hxx> #include <odb/sqlite/traits.hxx> diff --git a/odb/qt/containers/qhash-traits.hxx b/odb/qt/containers/qhash-traits.hxx index c34b768..b215a16 100644 --- a/odb/qt/containers/qhash-traits.hxx +++ b/odb/qt/containers/qhash-traits.hxx @@ -8,8 +8,8 @@ #include <odb/pre.hxx> -#include <QHash> -#include <QMultiHash> +#include <QtCore/QHash> +#include <QtCore/QMultiHash> #include <odb/container-traits.hxx> diff --git a/odb/qt/containers/qlinked-list-traits.hxx b/odb/qt/containers/qlinked-list-traits.hxx index 708e240..454079c 100644 --- a/odb/qt/containers/qlinked-list-traits.hxx +++ b/odb/qt/containers/qlinked-list-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QLinkedList> +#include <QtCore/QLinkedList> #include <odb/container-traits.hxx> diff --git a/odb/qt/containers/qlist-traits.hxx b/odb/qt/containers/qlist-traits.hxx index 9ac7cbf..e2c4c80 100644 --- a/odb/qt/containers/qlist-traits.hxx +++ b/odb/qt/containers/qlist-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QList> +#include <QtCore/QList> #include <odb/container-traits.hxx> diff --git a/odb/qt/containers/qmap-traits.hxx b/odb/qt/containers/qmap-traits.hxx index 854dc87..c94c912 100644 --- a/odb/qt/containers/qmap-traits.hxx +++ b/odb/qt/containers/qmap-traits.hxx @@ -8,8 +8,8 @@ #include <odb/pre.hxx> -#include <QMap> -#include <QMultiMap> +#include <QtCore/QMap> +#include <QtCore/QMultiMap> #include <odb/container-traits.hxx> diff --git a/odb/qt/containers/qset-traits.hxx b/odb/qt/containers/qset-traits.hxx index 13216b9..3e21b95 100644 --- a/odb/qt/containers/qset-traits.hxx +++ b/odb/qt/containers/qset-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QSet> +#include <QtCore/QSet> #include <odb/container-traits.hxx> diff --git a/odb/qt/containers/qvector-traits.hxx b/odb/qt/containers/qvector-traits.hxx index c86aa01..eebe5e1 100644 --- a/odb/qt/containers/qvector-traits.hxx +++ b/odb/qt/containers/qvector-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QVector> +#include <QtCore/QVector> #include <odb/container-traits.hxx> diff --git a/odb/qt/date-time/mysql/default-mapping.hxx b/odb/qt/date-time/mysql/default-mapping.hxx index fa0b823..250d668 100644 --- a/odb/qt/date-time/mysql/default-mapping.hxx +++ b/odb/qt/date-time/mysql/default-mapping.hxx @@ -6,9 +6,9 @@ #ifndef ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX #define ODB_QT_DATE_TIME_MYSQL_DEFAULT_MAPPING_HXX -#include <QDate> -#include <QTime> -#include <QDateTime> +#include <QtCore/QDate> +#include <QtCore/QTime> +#include <QtCore/QDateTime> // Map QDate to MySQL DATE by default. QDate provides a null // representation so allow NULL values by default. diff --git a/odb/qt/date-time/mysql/qdate-time-traits.hxx b/odb/qt/date-time/mysql/qdate-time-traits.hxx index fcb2d79..db8840c 100644 --- a/odb/qt/date-time/mysql/qdate-time-traits.hxx +++ b/odb/qt/date-time/mysql/qdate-time-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QDateTime> +#include <QtCore/QDateTime> #include <odb/mysql/traits.hxx> diff --git a/odb/qt/date-time/mysql/qdate-traits.hxx b/odb/qt/date-time/mysql/qdate-traits.hxx index 4f1c753..a1b3fac 100644 --- a/odb/qt/date-time/mysql/qdate-traits.hxx +++ b/odb/qt/date-time/mysql/qdate-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QDate> +#include <QtCore/QDate> #include <odb/mysql/traits.hxx> #include <odb/qt/date-time/exceptions.hxx> diff --git a/odb/qt/date-time/mysql/qtime-traits.hxx b/odb/qt/date-time/mysql/qtime-traits.hxx index f984f1a..b90faef 100644 --- a/odb/qt/date-time/mysql/qtime-traits.hxx +++ b/odb/qt/date-time/mysql/qtime-traits.hxx @@ -8,7 +8,7 @@ #include <odb/pre.hxx> -#include <QTime> +#include <QtCore/QTime> #include <odb/mysql/traits.hxx> diff --git a/odb/qt/date-time/sqlite/default-mapping.hxx b/odb/qt/date-time/sqlite/default-mapping.hxx index 82321af..e497e96 100644 --- a/odb/qt/date-time/sqlite/default-mapping.hxx +++ b/odb/qt/date-time/sqlite/default-mapping.hxx @@ -6,9 +6,9 @@ #ifndef ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX #define ODB_QT_DATE_TIME_SQLITE_DEFAULT_MAPPING_HXX -#include <QDate> -#include <QTime> -#include <QDateTime> +#include <QtCore/QDate> +#include <QtCore/QTime> +#include <QtCore/QDateTime> // Map QDate to SQLite TEXT by default. QDate provides a null representation // so allow NULL values by default. diff --git a/odb/qt/date-time/sqlite/qdate-time-traits.hxx b/odb/qt/date-time/sqlite/qdate-time-traits.hxx index f36852f..7d34647 100644 --- a/odb/qt/date-time/sqlite/qdate-time-traits.hxx +++ b/odb/qt/date-time/sqlite/qdate-time-traits.hxx @@ -12,7 +12,7 @@ #include <cstddef> // std::size_t #include <cstring> // std::memcpy -#include <QDateTime> +#include <QtCore/QDateTime> #include <odb/details/buffer.hxx> #include <odb/sqlite/traits.hxx> diff --git a/odb/qt/date-time/sqlite/qdate-traits.hxx b/odb/qt/date-time/sqlite/qdate-traits.hxx index 7d8215b..a1d7d6c 100644 --- a/odb/qt/date-time/sqlite/qdate-traits.hxx +++ b/odb/qt/date-time/sqlite/qdate-traits.hxx @@ -12,7 +12,7 @@ #include <cstddef> // std::size_t #include <cstring> // std::memcpy -#include <QDate> +#include <QtCore/QDate> #include <odb/details/buffer.hxx> #include <odb/sqlite/traits.hxx> diff --git a/odb/qt/date-time/sqlite/qtime-traits.hxx b/odb/qt/date-time/sqlite/qtime-traits.hxx index d50332f..7c99831 100644 --- a/odb/qt/date-time/sqlite/qtime-traits.hxx +++ b/odb/qt/date-time/sqlite/qtime-traits.hxx @@ -12,7 +12,7 @@ #include <cstddef> // std::size_t #include <cstring> // std::memcpy -#include <QTime> +#include <QtCore/QTime> #include <odb/details/buffer.hxx> #include <odb/sqlite/traits.hxx> diff --git a/odb/qt/smart-ptr.options b/odb/qt/smart-ptr.options index f9de219..636b130 100644 --- a/odb/qt/smart-ptr.options +++ b/odb/qt/smart-ptr.options @@ -7,7 +7,7 @@ # Make QSharedPointer the default object pointer. # ---hxx-prologue '#include <QSharedPointer>' +--hxx-prologue '#include <QtCore/QSharedPointer>' --default-pointer QSharedPointer # Include pointer traits. diff --git a/odb/qt/smart-ptr/lazy-ptr.hxx b/odb/qt/smart-ptr/lazy-ptr.hxx index 0d0e60a..e22dc3e 100644 --- a/odb/qt/smart-ptr/lazy-ptr.hxx +++ b/odb/qt/smart-ptr/lazy-ptr.hxx @@ -8,9 +8,9 @@ #include <odb/pre.hxx> -#include <QSharedPointer> -#include <QWeakPointer> -#include <QGlobalStatic> +#include <QtCore/QSharedPointer> +#include <QtCore/QWeakPointer> +#include <QtCore/QGlobalStatic> #include <odb/forward.hxx> // odb::database #include <odb/traits.hxx> diff --git a/odb/qt/smart-ptr/pointer-traits.hxx b/odb/qt/smart-ptr/pointer-traits.hxx index 488e1db..8a981ba 100644 --- a/odb/qt/smart-ptr/pointer-traits.hxx +++ b/odb/qt/smart-ptr/pointer-traits.hxx @@ -8,8 +8,8 @@ #include <odb/pre.hxx> -#include <QSharedPointer> -#include <QWeakPointer> +#include <QtCore/QSharedPointer> +#include <QtCore/QWeakPointer> #include <odb/pointer-traits.hxx> |