wrapped registerQMetaTypesForQt5() in #if

This commit is contained in:
silverqx
2023-06-18 16:32:39 +02:00
parent e28c4e990a
commit cffc9623ec
2 changed files with 4 additions and 0 deletions

View File

@@ -397,7 +397,9 @@ namespace Query
static void checkInstance();
/*! Call QMetaType's register functions needed by the Qt 5. */
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static void registerQMetaTypesForQt5();
#endif
/*! Database configuration. */
Configuration m_configuration {};

View File

@@ -960,6 +960,7 @@ void DatabaseManager::checkInstance()
"Only one instance of DatabaseManager is allowed per process.");
}
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void DatabaseManager::registerQMetaTypesForQt5()
{
if (!QMetaType::hasRegisteredComparators<QtTimeZoneConfig>())
@@ -982,6 +983,7 @@ void DatabaseManager::registerQMetaTypesForQt5()
QMetaType::registerEqualsComparator<QVector<QVector<AttributeItem>>>();
#endif
}
#endif
} // namespace Orm