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

Create extension types for Q_GADGETs in a good way

    XMLWordPrintable

Details

    Description

      Some Q_GADGET types (QFont, etc.) might have extension types that wrap the calls to the gadget types. In a nutshell, the logic within the engine and compilers should be: if there's an extension type that "overwrites" a property (thus its READ/WRITE/...) of the extended type, use that extension type instead when interacting with such property.

      For example, we should prefer using property `pointSize` from QQuickFontValueType when interacting with QFont, not the QFont's `pointSize` property.

      However, we do not have any good way to create an extension type for a gadget (there's qmlExtendedObject() in qqml.h but it only works for QObject * - so gadgets are out).
      At present, gadget type objects are reinterpret_cast'ed into extension type objects (relying on the fact that extension types for gadgets in Qt only contain the gadget type they extend), this might get messy if we ever allow users to have their extensions on gadgets.

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              agolubev Andrei Golubev
              Vladimir Minenko Vladimir Minenko
              Alex Blasche 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