Skip to content
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

Merged
merged 1 commit into from
Oct 12, 2021

Conversation

Be-ing
Copy link
Contributor

@Be-ing Be-ing commented Oct 12, 2021

[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())
      |     ^~~~~~~~~

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
m_stringField("string", QMetaType(QMetaType::QString)) {
#else
m_stringField("string", QVariant::String){
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
m_stringField("string", QVariant::String){
m_stringField("string", QVariant::String) {

pre-commit insists on removing the space here... whatever 🤷

Copy link
Contributor

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.

#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
m_stringField("string", QMetaType(QMetaType::QString)) {
#else
m_stringField("string", QVariant::String){
Copy link
Contributor

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())
      |     ^~~~~~~~~
Copy link
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@uklotzde uklotzde merged commit 58572fb into mixxxdj:main Oct 12, 2021
@Be-ing Be-ing deleted the qsqlfield_qmetatype branch October 12, 2021 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants