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

QML Revisions in qmlRegisterUncreatableType not honored

    XMLWordPrintable

Details

    Description

      The QtLocation API uses the qmlRegisterUncreatableType() template function to register a new property called "preventStealing" which is part of QQuickGeoMapGestureArea from Qt 5.6 onwards:

      qmlRegisterUncreatableType<QQuickGeoMapGestureArea, 1>(uri, major, minor, "MapGestureArea",
                                              QStringLiteral("(Map)GestureArea is not intended instantiable by developer."));
      

      The property is properly marked as REVISION 1. The following small QML app demonstrates the problem:

      import QtQuick 2.4
      import QtQuick.Window 2.2
      import QtPositioning 5.2
      import QtLocation 5.2
       
       Window {
          width: 400
          height: 500
      
          property variant topLeftEurope: QtPositioning.coordinate(60.5, 0.0)
          property variant bottomRightEurope: QtPositioning.coordinate(51.0, 14.0)
          property variant viewOfEurope: QtPositioning.rectangle(topLeftEurope, bottomRightEurope)
          
          Map {
              id: mapOfEurope
              anchors.centerIn: parent;
              anchors.fill: parent
              plugin: Plugin {
                  name: "osm"
              }
              
              // should NOT work
              gesture.preventStealing: false
              
              visibleRegion: viewOfEurope
          }
      }
      

      Since the general QtLocation import is 5.2 the QML engine should complain about the non-existing preventStealing property.

      Attachments

        Issue Links

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

          Activity

            People

              shausman Simon Hausmann
              ablasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes