Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2436

Python-based QML element as a QML component doesn't trigger non-slot connections

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P4: Low
    • None
    • 6.5.2
    • PySide
    • None
    • f762506f9 (dev), 247c14cf3 (6.5), 95cb332c3 (tqtc/lts-6.2)

    Description

      For some reason non-slot connections do not work if a QML element implemented in Python is used as a component in QML.

      Scenario:

      • A QObject registered to QML has a signal
      • It connects the signal to its own slots/non-slot methods
      • One of its slots is triggered by QML . The handler emits the signal

      Observation:

      • The non-slots methods are not called
      • The automatic registration of non-slot methods fails/causes a nested QMetaObject to be created

      A minimal example is attached, output:

      qml: trigger item
      called myMethodSlot()
      called onXChangedSlot()
      qml: trigger item2
      called myMethod()
      called myMethodSlot()
      called onXChanged()
      called onXChangedSlot()

      Attachments

        1. non_slot_signal_root_item.zip
          1 kB
        2. pyside2436_diag.diff
          10 kB
        3. pyside2436_log.txt
          49 kB
        4. pyside2436_widgetautoslot.zip
          3 kB
        5. pyside2436.zip
          4 kB

        Issue Links

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

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              machinekoder Alex Roessler
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes