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

Crash in QQmlPropertyCacheCreator<QQmlTypeCompiler>::propertyCacheForObject when a native QQuickItem subclass Q_PROPERTY adds a write accessor

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 5.12.9
    • QML: Compiler
    • None
    • Linux/X11

    Description

      After building MuseScore at [1] and running it once to populate `~/.cache/MuseScore/MuseScore3Development/qmlcache`, then building it with this change on top of [2] (a subset of the next commit [3]):

      --- a/mscore/qml/nativemenu.h
      +++ b/mscore/qml/nativemenu.h
      @@ -43 +43 @@ class QmlNativeMenu : public QQuickItem {
      -      Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
      +      Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged)
      @@ -61 +61,2 @@ class QmlNativeMenu : public QQuickItem {
      -      bool visible() const { return _visible; };
      +      bool visible() const { return _visible; }
      +      void setVisible(bool val);
      --- a/mscore/qml/nativemenu.cpp
      +++ b/mscore/qml/nativemenu.cpp
      @@ -90,0 +91,15 @@ void QmlNativeMenu::popup()
      +//---------------------------------------------------------
      +//   QmlNativeMenu::setVisible
      +//---------------------------------------------------------
      +
      +void QmlNativeMenu::setVisible(bool val)
      +      {
      +      if (val == _visible)
      +            return;
      +
      +      if (val)
      +            open();
      +      else
      +            Q_ASSERT(false); // trying to hide visible menu: not implemented and (is supposed to be) unused
      +      }
      +
      

      it crashes in QQmlPropertyCacheCreator<QQmlTypeCompiler>::propertyCacheForObject (on assert when asserts are enabled) like in QTBUG-62302 and QTBUG-62938 until I delete qmlcache or disable it with QML_DISABLE_DISK_CACHE.

      I'm not sure whether this is a Qt bug or if MuseScore is supposed to help Qt invalidate the cache.

      [1] any parent of https://github.com/musescore/MuseScore/commit/3ea1b104 , but not 3ea1b104

      [2] https://github.com/musescore/MuseScore/tree/f0cd7e95

      [3] https://github.com/musescore/MuseScore/commit/58b14547

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              orivej Orivej Desh
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes