Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Element

Element

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 767 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
    MartinD
    wrote on last edited by
    #1

    Hi,
    I use a QML element in my .qml files. It can be root item or it can be nested in another items.

    I want all these QML elements to have height of half of the Window element (which is root of all QML elements in my application)? How to do that?

    FlotisableF 1 Reply Last reply
    0
    • M MartinD

      Hi,
      I use a QML element in my .qml files. It can be root item or it can be nested in another items.

      I want all these QML elements to have height of half of the Window element (which is root of all QML elements in my application)? How to do that?

      FlotisableF Offline
      FlotisableF Offline
      Flotisable
      wrote on last edited by
      #2

      @MartinD
      I think you can read QML property binding

      1 Reply Last reply
      0
      • Dmitiy TyuginD Offline
        Dmitiy TyuginD Offline
        Dmitiy Tyugin
        wrote on last edited by
        #3

        Add id to your window

        Window{
        id: screen
        ...
        }
        

        In any other QML file

        Rectangle{
            height: screen.height/2
        }
        

        This will work if Window is a main application window.

        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