Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Designer: Providing context in “dummydata/context” doesn't work
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 684 Views
  • 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 Offline
    M Offline
    MarcVanDaele
    wrote on last edited by
    #1

    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
    0
    • T Offline
      T Offline
      Thomas Hartmann
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved