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

Cannot access a QGraphicsProxyWidget item through a property alias in QML

    XMLWordPrintable

Details

    Description

      Please see the attached example (don't forget to set the correct path to the test.qml file in main.cpp)

      We create a QGraphicsProxyWidget subclass to embed a QTextEdit in QML. It works well, but we cannot access the item through a property alias. We get an error message in the console.

      Rectangle {
      	property alias propAlias: textEdit
      
      	width: 400
      	height: 320
      
      	SuperTextEdit {  // <-- this is our QGraphicsProxyWidget subclass
      		id: textEdit
      	}
      
      	Component.onCompleted: {
      		console.log(propAlias); // <-- outputs an error message in the console
      	}
      }
      

      Error message in the console:

      QMetaProperty::read: Unable to handle unregistered datatype '*' for property 'QDeclarativeRectangle_QML_1::propAlias'
      

      Attachments

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

        Activity

          People

            aakenned Aaron Kennedy
            gregschlom Gregory Schlomoff
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes