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

"TypeError: Cannot read property of null" warning when closing application with a ButtonStyle component defined in a QML singleton

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.5.0
    • Quick: Controls 1
    • None

    Description

      Full error message:

      file:///home/mitch/dev/Qt5.5.0/5.5/gcc_64/qml/QtQuick/Controls/Styles/Base/ButtonStyle.qml:151: TypeError: Cannot read property of null
      

      main.qml:

      import QtQuick 2.3
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.0
      
      import "."
      
      Window {
          visible: true
      
          Button {
              text: "hello!"
              anchors.centerIn: parent
              style: GameStyle.buttonStyle
          }
      }
      

      GameStyle.qml:

      pragma Singleton
      
      import QtQuick 2.4
      import QtQuick.Controls 1.3
      import QtQuick.Controls.Styles 1.3
      
      Item {
          // produces warnings on exit when used
          property Component buttonStyle: ButtonStyle {
          }
      }
      

      qmldir:

      singleton GameStyle 1.0 GameStyle.qml
      

      Attachments

        Issue Links

          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
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes