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 build errors from deprecated QByteArray::count(), QVariant::type(), QEventPoint::pos() #9961

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andersk
Copy link
Contributor

@andersk andersk commented Oct 15, 2024

Description

In file included from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dnsutilslinux.h:12,
                 from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbusservice.h:13,
                 from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/moc_dbusservice.cpp:9,
                 from /build/source/build/src/mozillavpn_autogen/mocs_compilation.cpp:88:
/build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbustypeslinux.h: In function 'const QDBusArgument& operator>>(const QDBusArgument&, DnsResolver&)':
/build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbustypeslinux.h:49:26: error: 'qsizetype QByteArray::count() const' is deprecated: Use size() or length() instead. [-Werror=deprecated-declarations]
   49 |     } else if (data.count() >= 4) {
      |                ~~~~~~~~~~^~
In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qstringview.h:10,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qchar.h:660,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qstring.h:14,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qcoreapplication.h:8,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qaccessible.h:17,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/QAccessible:1,
                 from /build/source/build/src/mozillavpn_autogen/EWIEGA46WW/../../../../src/accessiblenotification.h:8,
                 from /build/source/build/src/mozillavpn_autogen/EWIEGA46WW/moc_accessiblenotification.cpp:9,
                 from /build/source/build/src/mozillavpn_autogen/mocs_compilation.cpp:2:
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qbytearray.h:501:22: note: declared here
  501 |     inline qsizetype count() const noexcept { return size(); }
      |                      ^~~~~
/build/source/src/platforms/linux/daemon/apptracker.cpp: In member function 'void AppTracker::userCreated(uint, const QString&)':
/build/source/src/platforms/linux/daemon/apptracker.cpp:73:42: error: 'QVariant::Type QVariant::type() const' is deprecated: Use typeId() or metaType(). [-Werror=deprecated-declarations]
   73 |   if (!m_cgroupMount.isEmpty() && qv.type() == QVariant::String) {
      |                                   ~~~~~~~^~
In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtDBus/qtdbusglobal.h:9,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtDBus/qdbusconnection.h:8,
                 from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtDBus/QDBusConnection:1,
                 from /build/source/src/platforms/linux/daemon/apptracker.cpp:9:
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qvariant.h:433:10: note: declared here
  433 |     Type type() const
      |          ^~~~
/build/source/src/itempicker.cpp: In member function 'QList<QQuickItem*> ItemPicker::pickItem(QMouseEvent*, QQuickItem*)':
/build/source/src/itempicker.cpp:87:57: error: 'QPoint QMouseEvent::globalPos() const' is deprecated: Use globalPosition() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
   87 |     QPointF gpos = child->mapFromGlobal(event->globalPos());
      |                                         ~~~~~~~~~~~~~~~~^~
In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/QMouseEvent:1,
                 from /build/source/src/itempicker.cpp:9:
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:224:19: note: declared here
  224 |     inline QPoint globalPos() const { return globalPosition().toPoint(); }
      |                   ^~~~~~~~~
/build/source/src/itempicker.cpp:102:59: error: 'QPoint QMouseEvent::globalPos() const' is deprecated: Use globalPosition() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  102 |       QPointF gpos = child->mapFromGlobal(event->globalPos());
      |                                           ~~~~~~~~~~~~~~~~^~
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:224:19: note: declared here
  224 |     inline QPoint globalPos() const { return globalPosition().toPoint(); }
      |                   ^~~~~~~~~
/build/source/src/itempicker.cpp: In member function 'QList<QQuickItem*> ItemPicker::pickItem(QTouchEvent*, QQuickItem*)':
/build/source/src/itempicker.cpp:117:25: error: 'const QList<QEventPoint>& QTouchEvent::touchPoints() const' is deprecated: Use points() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  117 |   if (event->touchPoints().length() != 1) {
      |       ~~~~~~~~~~~~~~~~~~^~
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:939:31: note: declared here
  939 |     const QList<QEventPoint> &touchPoints() const { return points(); }
      |                               ^~~~~~~~~~~
/build/source/src/itempicker.cpp:123:53: error: 'const QList<QEventPoint>& QTouchEvent::touchPoints() const' is deprecated: Use points() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  123 |   QTouchEvent::TouchPoint point = event->touchPoints()[0];
      |                                   ~~~~~~~~~~~~~~~~~~^~
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:939:31: note: declared here
  939 |     const QList<QEventPoint> &touchPoints() const { return points(); }
      |                               ^~~~~~~~~~~
/build/source/src/itempicker.cpp:124:26: error: 'QPointF QEventPoint::pos() const' is deprecated: Use position() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  124 |   QPointF pos = point.pos();
      |                 ~~~~~~~~~^~
In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:20:
/nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qeventpoint.h:87:13: note: declared here
   87 |     QPointF pos() const { return position(); }
      |             ^~~

Reference

https://code.qt.io/cgit/qt/qtbase.git/commit?id=65859635830b1476ce5c3e22f86438a08d4894cf
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=11bad6109606794091adc3b8a14070ac09707f45
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=24e52c10deedbaef833c0e2c3ee7bee03eacc4f5
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=2692237bb1b0c0f50b7cc5d920eb8ab065063d47

Checklist

  • My code follows the style guidelines for this project
  • I have not added any packages that contain high risk or unknown licenses (GPL, LGPL, MPL, etc. consult with DevOps if in question)
  • I have performed a self review of my own code
  • I have commented my code PARTICULARLY in hard to understand areas
  • I have added thorough tests where needed

@andersk andersk changed the title Fix build error from deprecated QByteArray::count() Fix build error from deprecated QByteArray::count(), QVariant::type() Oct 15, 2024
@andersk andersk changed the title Fix build error from deprecated QByteArray::count(), QVariant::type() Fix build errors from deprecated QByteArray::count(), QVariant::type() Oct 15, 2024
    In file included from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dnsutilslinux.h:12,
                     from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbusservice.h:13,
                     from /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/moc_dbusservice.cpp:9,
                     from /build/source/build/src/mozillavpn_autogen/mocs_compilation.cpp:88:
    /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbustypeslinux.h: In function 'const QDBusArgument& operator>>(const QDBusArgument&, DnsResolver&)':
    /build/source/build/src/mozillavpn_autogen/UM7GZO45JR/../../../../src/platforms/linux/daemon/dbustypeslinux.h:49:26: error: 'qsizetype QByteArray::count() const' is deprecated: Use size() or length() instead. [-Werror=deprecated-declarations]
       49 |     } else if (data.count() >= 4) {
          |                ~~~~~~~~~~^~
    In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qstringview.h:10,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qchar.h:660,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qstring.h:14,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qcoreapplication.h:8,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qaccessible.h:17,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/QAccessible:1,
                     from /build/source/build/src/mozillavpn_autogen/EWIEGA46WW/../../../../src/accessiblenotification.h:8,
                     from /build/source/build/src/mozillavpn_autogen/EWIEGA46WW/moc_accessiblenotification.cpp:9,
                     from /build/source/build/src/mozillavpn_autogen/mocs_compilation.cpp:2:
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qbytearray.h:501:22: note: declared here
      501 |     inline qsizetype count() const noexcept { return size(); }
          |                      ^~~~~

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
    /build/source/src/platforms/linux/daemon/apptracker.cpp: In member function 'void AppTracker::userCreated(uint, const QString&)':
    /build/source/src/platforms/linux/daemon/apptracker.cpp:73:42: error: 'QVariant::Type QVariant::type() const' is deprecated: Use typeId() or metaType(). [-Werror=deprecated-declarations]
       73 |   if (!m_cgroupMount.isEmpty() && qv.type() == QVariant::String) {
          |                                   ~~~~~~~^~
    In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtDBus/qtdbusglobal.h:9,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtDBus/qdbusconnection.h:8,
                     from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtDBus/QDBusConnection:1,
                     from /build/source/src/platforms/linux/daemon/apptracker.cpp:9:
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtCore/qvariant.h:433:10: note: declared here
      433 |     Type type() const
          |          ^~~~

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
    /build/source/src/itempicker.cpp: In member function 'QList<QQuickItem*> ItemPicker::pickItem(QMouseEvent*, QQuickItem*)':
    /build/source/src/itempicker.cpp:87:57: error: 'QPoint QMouseEvent::globalPos() const' is deprecated: Use globalPosition() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
       87 |     QPointF gpos = child->mapFromGlobal(event->globalPos());
          |                                         ~~~~~~~~~~~~~~~~^~
    In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/QMouseEvent:1,
                     from /build/source/src/itempicker.cpp:9:
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:224:19: note: declared here
      224 |     inline QPoint globalPos() const { return globalPosition().toPoint(); }
          |                   ^~~~~~~~~
    /build/source/src/itempicker.cpp:102:59: error: 'QPoint QMouseEvent::globalPos() const' is deprecated: Use globalPosition() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
      102 |       QPointF gpos = child->mapFromGlobal(event->globalPos());
          |                                           ~~~~~~~~~~~~~~~~^~
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:224:19: note: declared here
      224 |     inline QPoint globalPos() const { return globalPosition().toPoint(); }
          |                   ^~~~~~~~~
    /build/source/src/itempicker.cpp: In member function 'QList<QQuickItem*> ItemPicker::pickItem(QTouchEvent*, QQuickItem*)':
    /build/source/src/itempicker.cpp:117:25: error: 'const QList<QEventPoint>& QTouchEvent::touchPoints() const' is deprecated: Use points() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
      117 |   if (event->touchPoints().length() != 1) {
          |       ~~~~~~~~~~~~~~~~~~^~
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:939:31: note: declared here
      939 |     const QList<QEventPoint> &touchPoints() const { return points(); }
          |                               ^~~~~~~~~~~
    /build/source/src/itempicker.cpp:123:53: error: 'const QList<QEventPoint>& QTouchEvent::touchPoints() const' is deprecated: Use points() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
      123 |   QTouchEvent::TouchPoint point = event->touchPoints()[0];
          |                                   ~~~~~~~~~~~~~~~~~~^~
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:939:31: note: declared here
      939 |     const QList<QEventPoint> &touchPoints() const { return points(); }
          |                               ^~~~~~~~~~~
    /build/source/src/itempicker.cpp:124:26: error: 'QPointF QEventPoint::pos() const' is deprecated: Use position() [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
      124 |   QPointF pos = point.pos();
          |                 ~~~~~~~~~^~
    In file included from /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qevent.h:20:
    /nix/store/bgfalfi93kbn8j1wfwz0x0dnk1wx9wdp-qtbase-6.8.0/include/QtGui/qeventpoint.h:87:13: note: declared here
       87 |     QPointF pos() const { return position(); }
          |             ^~~

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@andersk andersk changed the title Fix build errors from deprecated QByteArray::count(), QVariant::type() Fix build errors from deprecated QByteArray::count(), QVariant::type(), QEventPoint::pos Oct 15, 2024
@andersk andersk changed the title Fix build errors from deprecated QByteArray::count(), QVariant::type(), QEventPoint::pos Fix build errors from deprecated QByteArray::count(), QVariant::type(), QEventPoint::pos() Oct 15, 2024
@XavierCLL
Copy link

XavierCLL commented Oct 19, 2024

Hi @andersk thanks for your patches, I can successfully build the MozillaVPN, the CLI is working however the UI is not working, at least in Archlinux (+wayland), so I think there are more things to update (or an issue in your patches?):

'mozillavpn' terminated by signal SIGSEGV (Address boundary error)
Thread 1 "mozillavpn" received signal SIGSEGV, Segmentation fault.
0x00007ffff5dea6b4 in QWindow::mapToGlobal(QPointF const&) const () from /usr/lib/libQt6Gui.so.6

backtrace.txt

(note that I'm not a mozilla developer btw)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MozillaVPN is not compatible with Qt 6.8
2 participants