-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qt6: use new QSqlField constructor with QMetaType #4376
Conversation
Be-ing
commented
Oct 12, 2021
•
edited
Loading
edited
src/library/queryutil.h
Outdated
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) | ||
m_stringField("string", QMetaType(QMetaType::QString)) { | ||
#else | ||
m_stringField("string", QVariant::String){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_stringField("string", QVariant::String){ | |
m_stringField("string", QVariant::String) { |
pre-commit insists on removing the space here... whatever 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_stringField("string",
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QMetaType(QMetaType::QString)
#else
QVariant::String
#endif
) {
or otherwise try to move only the opening curly brace outside of the #ifdef.
src/library/queryutil.h
Outdated
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) | ||
m_stringField("string", QMetaType(QMetaType::QString)) { | ||
#else | ||
m_stringField("string", QVariant::String){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
m_stringField("string",
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QMetaType(QMetaType::QString)
#else
QVariant::String
#endif
) {
or otherwise try to move only the opening curly brace outside of the #ifdef.
[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()) | ^~~~~~~~~
2037f73
to
079f7cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! LGTM