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

qtquickview_java and _kotlin example QML Button signal disconnect doesn't work

    XMLWordPrintable

Details

    • Android
    • 214369f75 (6.9)

    Description

      Steps to reproduce:

      1. Build either qtquickview_java or qtquickview_kotlin (the multiview version)
      2. Click on the "QML Button signal disconnect" button
      3. Click on the upper "CHANGE COLOR" button

      Expected:

          Color doesn't change

      Actual:

          Color changes

       

      This is because both QMLContents get statusChangeListeners:

       

      m_firstQmlContent.setStatusChangeListener(this)
      m_secondQmlContent.setStatusChangeListener(this)

      ...and onStatusChanged gets executed twice - on both times we make a connection to the First QML Views onClicked() signal and after that nothing can be done to disconnect the first one.

      You can also see this when clicking on the "CHANGE COLOR" button once:

      2025-02-04 14:05:28.090  5516-5516  myTag                   com.example.qtquickview_kotlin       I  QML button clicked
      2025-02-04 14:05:28.091  5516-5516  myTag                   com.example.qtquickview_kotlin       I  QML button clicked

      Both listeners log the click.

       

      Attachments

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

        Activity

          People

            pevirkku Petri Virkkunen
            olvuolte Olli Vuolteenaho
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes