Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-9180

QtQuick Designer qml2puppet crashes for layouts of controls.

XMLWordPrintable

      QtQuick Designer qml2puppet crashes for layouts of controls.

      If an item is removed in in the Qt Quick Designer from the new QQuickLayouts
      we hit an assert.

      QQuickItem *QQuickLayoutAttached::item() const
      {
          Q_ASSERT(qobject_cast<QQuickItem*>(parent()));
          return static_cast<QQuickItem*>(parent());
      }
      

      stack trace:

      >	Qt5Cored.dll!qt_message_fatal(QtMsgType __formal, const QMessageLogContext & context, const QString & message) Line 937	C++
       	Qt5Cored.dll!QMessageLogger::fatal(const char * msg, ...) Line 360	C++
       	Qt5Cored.dll!qt_assert(const char * assertion, const char * file, int line) Line 1992	C++
       	qquicklayoutsplugind.dll!QQuickLayoutAttached::item() Line 350	C++
       	qquicklayoutsplugind.dll!QQuickLayoutAttached::parentLayout() Line 342	C++
       	qquicklayoutsplugind.dll!QQuickLayoutAttached::invalidateItem() Line 335	C++
       	qquicklayoutsplugind.dll!QQuickLayoutAttached::setMaximumHeight(double height) Line 220	C++
       	qquicklayoutsplugind.dll!QQuickGridLayoutBase::propagateLayoutSizeHints() Line 269	C++
       	qquicklayoutsplugind.dll!QQuickGridLayoutBase::rearrange(const QSizeF & size) Line 376	C++
       	qquicklayoutsplugind.dll!QQuickGridLayoutBase::geometryChanged(const QRectF & newGeometry, const QRectF & oldGeometry) Line 305	C++
       	Qt5Quickd.dll!QQuickItem::setImplicitHeight(double h) Line 5948	C++
       	qquicklayoutsplugind.dll!QQuickGridLayoutBase::propagateLayoutSizeHints() Line 267	C++
       	qquicklayoutsplugind.dll!QQuickGridLayoutBase::rearrange(const QSizeF & size) Line 376	C++
       	qquicklayoutsplugind.dll!QQuickLayout::event(QEvent * e) Line 379	C++
      
      

      It does not crash when I try repearenting in pure QML:

      import QtQuick 2.0
      import QtQuick.Controls 1.0
      import QtQuick.Layouts 1.0
      
      Item {
          id: root
          width: 1024
          height: 768
          states: [
              State {
                  name: "state02"
                  ParentChange { target: redRect; parent: root; x: 10; y: 10 }
              }
          ]
      
          ColumnLayout {
              
              Rectangle {
                  id: rext2
                  height: 200
                  width: 200
                  color: "blue"
                  MouseArea {
                      anchors.fill: parent
                      onClicked: {
                          root.state = "state02"
                      }
                  }
              }
      
              Rectangle {
                  id: redRect
                  height: 200
                  width: 200
                  color: "red"
              }
              
          }
      
      
      }
      

      My guess is that it asserts, because we also change the QObject parent?
      Any ideas?

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

            thohartm Thomas Hartmann
            thohartm Thomas Hartmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes