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

Fix Qt 5.15.2 deprecation warnings #3380

Merged
merged 4 commits into from
Nov 28, 2020

Conversation

Holzhaus
Copy link
Member

No description provided.

Fixes these warnings when compiling with Qt 5.15.2:

    In file included from src/widget/wknob.h:12,
                     from src/controllers/controllerlearningeventfilter.cpp:6:
    src/widget/knobeventhandler.h: In member function ‘void KnobEventHandler<T>::mousePressEvent(T*, QMouseEvent*)’:
    src/widget/knobeventhandler.h:62:22: error: ‘Qt::MidButton’ is deprecated: MidButton is deprecated. Use MiddleButton instead [-Werror=deprecated-declarations]
       62 |             case Qt::MidButton:
          |                      ^~~~~~~~~
    In file included from /usr/include/qt/QtCore/qbytearray.h:45,
                     from /usr/include/qt/QtCore/qstring.h:50,
                     from /usr/include/qt/QtCore/qhashfunctions.h:44,
                     from /usr/include/qt/QtCore/qlist.h:47,
                     from /usr/include/qt/QtCore/qhash.h:46,
                     from /usr/include/qt/QtCore/qdebug.h:45,
                     from /usr/include/qt/QtCore/QtDebug:1,
                     from src/controllers/controllerlearningeventfilter.cpp:1:
    /usr/include/qt/QtCore/qnamespace.h:132:9: note: declared here
      132 |         MidButton Q_DECL_ENUMERATOR_DEPRECATED_X("MidButton is deprecated. Use MiddleButton instead") = MiddleButton,
          |         ^~~~~~~~~
    In file included from src/widget/wknob.h:12,
                     from src/controllers/controllerlearningeventfilter.cpp:6:
    src/widget/knobeventhandler.h: In member function ‘void KnobEventHandler<T>::mouseReleaseEvent(T*, QMouseEvent*)’:
    src/widget/knobeventhandler.h:77:22: error: ‘Qt::MidButton’ is deprecated: MidButton is deprecated. Use MiddleButton instead [-Werror=deprecated-declarations]
       77 |             case Qt::MidButton:
          |                      ^~~~~~~~~
    In file included from /usr/include/qt/QtCore/qbytearray.h:45,
                     from /usr/include/qt/QtCore/qstring.h:50,
                     from /usr/include/qt/QtCore/qhashfunctions.h:44,
                     from /usr/include/qt/QtCore/qlist.h:47,
                     from /usr/include/qt/QtCore/qhash.h:46,
                     from /usr/include/qt/QtCore/qdebug.h:45,
                     from /usr/include/qt/QtCore/QtDebug:1,
                     from src/controllers/controllerlearningeventfilter.cpp:1:
    /usr/include/qt/QtCore/qnamespace.h:132:9: note: declared here
      132 |         MidButton Q_DECL_ENUMERATOR_DEPRECATED_X("MidButton is deprecated. Use MiddleButton instead") = MiddleButton,
          |         ^~~~~~~~~
Fixes:

    src/network/jsonwebtask.cpp: In function ‘QNetworkRequest mixxx::network::{anonymous}::newRequest(const QUrl&)’:
    src/network/jsonwebtask.cpp:104:43: error: ‘QNetworkRequest::FollowRedirectsAttribute’ is deprecated: Use RedirectPolicyAttribute [-Werror=deprecated-declarations]
      104 |     request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
          |                                           ^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/include/qt/QtNetwork/qnetworkaccessmanager.h:44,
                     from /usr/include/qt/QtNetwork/QNetworkAccessManager:1,
                     from src/network/webtask.h:4,
                     from src/network/jsonwebtask.h:7,
                     from src/network/jsonwebtask.cpp:1:
    /usr/include/qt/QtNetwork/qnetworkrequest.h:97:9: note: declared here
       97 |         FollowRedirectsAttribute Q_DECL_ENUMERATOR_DEPRECATED_X("Use RedirectPolicyAttribute"),
          |         ^~~~~~~~~~~~~~~~~~~~~~~~
src/widget/wspinny.cpp: In member function ‘virtual void WSpinny::mouseMoveEvent(QMouseEvent*)’:
src/widget/wspinny.cpp:593:35: error: ‘Qt::MidButton’ is deprecated: MidButton is deprecated. Use MiddleButton instead [-Werror=deprecated-declarations]
  593 |     } else if (e->buttons() & Qt::MidButton) {
      |                                   ^~~~~~~~~
In file included from /usr/include/qt/QtCore/qcoreevent.h:43,
                 from /usr/include/qt/QtCore/QEvent:1,
                 from src/widget/wspinny.h:5,
                 from src/widget/wspinny.cpp:1:
/usr/include/qt/QtCore/qnamespace.h:132:9: note: declared here
  132 |         MidButton Q_DECL_ENUMERATOR_DEPRECATED_X("MidButton is deprecated. Use MiddleButton instead") = MiddleButton,
      |         ^~~~~~~~~
@Holzhaus Holzhaus added this to the 2.3.0 milestone Nov 28, 2020
@Holzhaus Holzhaus changed the title Fix Qt 5.15.2 deprecations warnings Fix Qt 5.15.2 deprecation warnings Nov 28, 2020
@github-actions github-actions bot added the ui label Nov 28, 2020
    src/widget/wpushbutton.cpp: In member function ‘virtual bool WPushButton::event(QEvent*)’:
    src/widget/wpushbutton.cpp:453:59: error: ‘constexpr QFlags<T>::QFlags(QFlags<T>::Zero) [with Enum = Qt::KeyboardModifier; QFlags<T>::Zero = int QFlags<Qt::KeyboardModifier>::Private::*]’ is deprecated: Use default constructor instead [-Werror=deprecated-declarations]
      453 |                     Qt::MouseEventSynthesizedByApplication);
          |                                                           ^
    In file included from /usr/include/qt/QtCore/qglobal.h:1304,
                     from /usr/include/qt/QtGui/qtguiglobal.h:43,
                     from /usr/include/qt/QtGui/qevent.h:43,
                     from /usr/include/qt/QtGui/QPaintEvent:1,
                     from src/widget/wpushbutton.h:21,
                     from src/widget/wpushbutton.cpp:18:
    /usr/include/qt/QtCore/qflags.h:123:80: note: declared here
      123 |     QT_DEPRECATED_X("Use default constructor instead") Q_DECL_CONSTEXPR inline QFlags(Zero) noexcept : i(0) {}
          |
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.

LGTM

@uklotzde uklotzde merged commit 66a6345 into mixxxdj:2.3 Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants