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

QtQuick BusyIndicator erroneously goes to running state

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.6.0, 5.6.1
    • None

    Description

      In a Qt application embedding QtQuick components, the BusyIndicator will under some conditions go to the running state without being asked to.

      The QtQuick component (a QtQuickWidget) needs to be a child of a QTabWidget. When switching tabs, the BusyIndicator will go in the spurious running state.

      This minimalistic app demonstrates the problem:

      busy.pro

      TEMPLATE = app
      TARGET = busy
       
      QT = core gui widgets quickwidgets
       
      SOURCES += main.cpp
      

      main.cpp

      #include <QApplication>
      #include <QQuickWidget>
      #include <QTabWidget>
      #include <QUrl>
      
      QQuickWidget *createQuickWidget()
      {
       QQuickWidget *qw = new QQuickWidget();
       qw->setResizeMode(QQuickWidget::SizeRootObjectToView);
       qw->setSource(QUrl::fromLocalFile("busy.qml"));
       return qw;
      }
      
       
      int main(int argc, char **argv)
      {
       QApplication app (argc, argv);
      
       QTabWidget tab;
       tab.addTab(createQuickWidget(), "Tab1");
       tab.addTab(createQuickWidget(), "Tab2");
       tab.show();
      
       return app.exec();
      }
      

      busy.qml

      import QtQuick 2.4
      import QtQuick.Controls 1.4
      
      Item {
        MouseArea {
          id: mousearea
          anchors.fill: parent
        }
        BusyIndicator {
          running: mousearea.pressed
        }
      }
      

      Place all three files in a directory and run : qmake & make
      Run the app with ./debug/busy[.exe]

      To reproduce:

      • click inside one of the tabs to run the BusyIndicator at least once
      • switch tab
      • come back to 1st clicked tab ==> BusyIndicator should run
      • click tab again to stop BusyIndicator
      • repeat

      This issue has been reproduced with the minimal example on Qt 5.6.1 (msys2).
      This issue affects our real application on Qt 5.6.0 (msys2 and ubuntu)

      Attachments

        1. busy.pro
          0.1 kB
        2. busy.qml
          0.2 kB
        3. main.cpp
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            philippe_renon Philippe Renon
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes