Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Missing parent in hierarchical qml files - StackView component (tutorial: Qt Cloud : To Do )

    QML and Qt Quick
    2
    3
    966
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      thevdeub last edited by

      Sorry for the noob question, I just cannot figure it out :)
      in the tutorial : https://developer.qtcloudservices.com/mar/tutorials/todo

      they use parenting to create the hierarchy of qml edits.
      Opening the home.qml directly in the Quick Editor , I have missing 'parent' anchor.

      it makes sense the qml is defined as :
      @
      Item {
      width: parent.width
      height: parent.height
      }
      @

      and usually called from main.qml like this:

      @
      StackView {
      id: mainView
      anchors.fill: parent
      initialItem: Qt.resolvedUrl("Home.qml");
      }
      @

      Now, I want to edit the home.qml component/widget into the Editor.
      How can I bypass the error/warning of the missing anchor ? 'missing parent'

      I do not understand why we cannot edit this component from "the main.qml" component.
      The 'Go Into Component' is grey.
      Selecting the 'mainview' into the editor, the 'StackView' tab is empty.

      what s the trick ?

      [Edited - Please use code tags "@@" - p3c0]

      1 Reply Last reply Reply Quote 0
      • J
        jcbritobr last edited by

        There is a "ignore" option for the error message, doesn't?

        1 Reply Last reply Reply Quote 0
        • T
          thevdeub last edited by

          Correct. but if I "ignore" the errors, the UI is scrambled and unusable.
          I suppose they use 'default' values to replace the parent's ones.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post