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

QtBridges-Python: Support QML ClassInfo of DefaultProperty

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • Qt Bridges

      The bridge_type() API should accept a new `default_property` keyword argument which adds the default property class info to the metaobject.

      eg:     bridge_type(Box, uri="backend", version="1.0", default_property="child")

       

      QML code:
      Box {
      id: testBox
      // Widget will be assigned to child property
      Widget

      { text: "Hello from Widget!" }

      }
       
      Python class:
      class Box:
      """Container with a single child widget"""
      def_init_(self):
      self._child=None

      @property
      defchild(self) -> Widget:
      returnself._child

      @child.setter
      defchild(self, value: Widget) -> None:
      self._child=value

      defhas_child(self) -> bool:
      returnself._childisnotNone
       

       

        For Gerrit Dashboard: QTBUG-141498
        # Subject Branch Project Status CR V

            shpremna Shyamnath Premnadh
            shpremna Shyamnath Premnadh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change