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

Allow for extending the QML interface with custom items in C++

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Out of scope
    • P2: Important
    • 5.8.0
    • 4.7.2
    • Qt3D
    • None

    Description

      Originally reported by David.Robinson@anite.com

      1. I don't know if the Qt3d project has got any kind of position on this but I would like to more easily be able to derive new classes from QML components in order to create my own. I think that is a reasonable request to make of any API.

      To this end would it be possible as you home in on a TP1 for the project to extract the QML private headers for QDeclarativeItem3DPrivate in the Qt3DQuick library into a separate include file as in the attached example. This would then allow users to include the Private data header & add to it in a derived private header class. This avoids code duplication that needs to be maintained when private headers change as we are warned they could.

      The same private header shift might apply to the qthreedqmlplugin as well for ViewportPrivate, ShaderProgramPrivate etc.

      2. Also I'd like to submit a simple change to the QML Mesh class in the Qt3DQuick library as attached. The optional declarative engine arg allows another QML C++ class to set the mesh source file programmatically by passing its own engine, different from the Mesh qmlEngine(this). This is necessary to enable the mesh class to use the networkAccessManager for a mesh source Url specified in another Qml/3d component.

      The header signature has changed only as follows:

          void setSource(const QUrl& value, {color:red}QDeclarativeEngine* engine = 0{color});
      

      and the implementation:

          QDeclarativeEngine* eng = engine ? engine : qmlEngine(this);
          d->dataReply = eng->networkAccessManager()->get(req);
      

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            sarasmit Sarah Smith (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes