Skip to content

Qt6: use new QSqlField constructor with QMetaType#4376

Merged
uklotzde merged 1 commit intomixxxdj:mainfrom
Be-ing:qsqlfield_qmetatype
Oct 12, 2021
Merged

Qt6: use new QSqlField constructor with QMetaType#4376
uklotzde merged 1 commit intomixxxdj:mainfrom
Be-ing:qsqlfield_qmetatype

Conversation

@Be-ing
Copy link
Copy Markdown
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())
      |     ^~~~~~~~~

Comment thread 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){
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread 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){
Copy link
Copy Markdown
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())
      |     ^~~~~~~~~
@Be-ing Be-ing force-pushed the qsqlfield_qmetatype branch from 2037f73 to 079f7cd Compare October 12, 2021 08:28
Copy link
Copy Markdown
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