Qt Forum

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

    Unsolved Qt Designer: Providing context in “dummydata/context” doesn't work

    Tools
    2
    2
    548
    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.
    • M
      MarcVanDaele last edited by

      A component often uses some context properties (eg parent.width) and hence, when designing this component in Qt Quick Designer, it is useful to somehow provide this context.

      The Qt Quick Designer documentation states that it should be possible to provide this parent context object in the dummydata/context directory.

      However, I don't get it working

      I have a main.qml file containing

      import QtQuick 2.0
      
      Rectangle {
          width:parent.width
          height:parent.height
          color: "green"
      }
      

      and I have a dummydata/context/main.qml file containing

      import QtQuick 1.0
      import QmlDesigner 1.0
      
      DummyContextObject {
          parent: Item {
              width: 640
              height: 300
          }
      }
      

      However, when opening main.qml in Designer, it still gets width=height=0.

      Any ideas how to get this working?

      1 Reply Last reply Reply Quote 0
      • T
        Thomas Hartmann last edited by

        To be honest this is a feature we haven't tested for a long time in the Qt Quick 2 context. Can you create an official bug report.

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