From 2037f73e67ce191ed4d563fd477b801b51c00739 Mon Sep 17 00:00:00 2001 From: Be Date: Mon, 11 Oct 2021 20:29:23 -0500 Subject: [PATCH] Qt6: use new QSqlField constructor with QMetaType MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [56/585] Building CXX object CMakeFiles/mixxx-lib.dir/src/dialog/dlgreplacecuecolor.cpp.o In file included from ../src/dialog/dlgreplacecuecolor.cpp:12: ../src/library/queryutil.h: In constructor ‘FieldEscaper::FieldEscaper(const QSqlDatabase&)’: ../src/library/queryutil.h:77:15: warning: ‘QSqlField::QSqlField(const QString&, QVariant::Type, const QString&)’ is deprecated: Use the constructor using a QMetaType instead [-Wdeprecated-declarations] 77 | m_stringField("string", QVariant::String) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/qt6/QtSql/QtSql:9, from ../src/library/queryutil.h:4, from ../src/dialog/dlgreplacecuecolor.cpp:12: /usr/include/qt6/QtSql/qsqlfield.h:85:5: note: declared here 85 | QSqlField(const QString& fieldName, QVariant::Type type, const QString &tableName = QString()) | ^~~~~~~~~ --- src/library/queryutil.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/library/queryutil.h b/src/library/queryutil.h index 7c22376d8df7..b3a91ed9332e 100644 --- a/src/library/queryutil.h +++ b/src/library/queryutil.h @@ -74,7 +74,11 @@ class FieldEscaper final { public: FieldEscaper(const QSqlDatabase& database) : m_database(database), - m_stringField("string", QVariant::String) { +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + m_stringField("string", QMetaType(QMetaType::QString)) { +#else + m_stringField("string", QVariant::String){ +#endif } // Escapes a string for use in a SQL query by wrapping with quotes and