Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-83403

Warnings about deprecated QTouchEvent::TouchPoint::setScreenRect in Qtgui

    XMLWordPrintable

Details

    • cf4a8b12fa277c2ea218f022607934f60fed1a06 (qt/qtbase/5.15)

    Description

      /home/tjmaciei/src/qt/qt5/qtbase/src/corelib/plugin/qfactoryloader.cpp:145:31: warning: 'fromBinaryData' is deprecated: Use CBOR format instead [-Wdeprecated-declarations]
              return QJsonDocument::fromBinaryData(json);
                                    ^
      ../../include/QtCore/../../../../../../src/qt/qt5/qtbase/src/corelib/serialization/qjsondocument.h:121:21: note: 'fromBinaryData' has been explicitly marked deprecated here
          __attribute__ ((__deprecated__("Use CBOR format instead")))
                          ^
      1 warning generated.
      /home/tjmaciei/src/qt/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:692:11: warning: 'setScreenRect' is deprecated: Use setScreenPos() and setEllipseDiameters() [-Wdeprecated-declarations]
              p.setScreenRect(QHighDpi::fromNativePixels(point->area, window));
                ^
      ../../include/QtGui/../../../../../../src/qt/qt5/qtbase/src/gui/kernel/qevent.h:950:25: note: 'setScreenRect' has been explicitly marked deprecated here
              __attribute__ ((__deprecated__("Use setScreenPos() and setEllipseDiameters()")))
                              ^
      /home/tjmaciei/src/qt/qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:753:46: warning: 'screenRect' is deprecated: Use screenPos() and ellipseDiameters() [-Wdeprecated-declarations]
              p.area = QHighDpi::toNativePixels(pt.screenRect(), window);
                                                   ^
      ../../include/QtGui/../../../../../../src/qt/qt5/qtbase/src/gui/kernel/qevent.h:942:25: note: 'screenRect' has been explicitly marked deprecated here
              __attribute__ ((__deprecated__("Use screenPos() and ellipseDiameters()")))
                              ^
      2 warnings generated.
      

      Current code:

              p.setScreenPos(QHighDpi::fromNativePixels(screenPos, window));
              p.setScreenRect(QHighDpi::fromNativePixels(point->area, window));
      

      Implementation of setScreenRect:

          d->screenPos = screenRect.center();
          d->ellipseDiameters = screenRect.size();
      

      So the expected solution is:

              p.setScreenPos(QHighDpi::fromNativePixels(screenPos, window));
              p.setScreenPos(QHighDpi::fromNativePixels(point->area, window).center());
              p.setEllipseDiameters(QHighDpi::fromNativePixels(point->area, window).size())
      

      Which indicates something is wrong.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            thiago Thiago Macieira
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes