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. positioning with layouts revisited
Qt 6.11 is out! See what's new in the release blog

positioning with layouts revisited

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 388 Views 1 Watching
  • 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    (Similar but not identical to another post I made a few weeks back.)

    I'm trying to use layouts, but they seem to interfere with various attempts to position/contain items within them. For example, This code:

    ColumnLayout {
      width: root.width * 0.8
      x: (parent.width - width) / 2
      y: 40
    
      Repeater {
        RunSynthStepSummary {
      ...
    

    RunSynthStepSummary.qml:

    ColumnLayout {
    id: root
    width: parent.width
    
    //  Item {
    //   height: parent.height
    //   width: parent.width
    
      Text {
      Layout.topMargin: 10
      width: root.width
      wrapMode: Text.WordWrap
      text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut augue elit, "
       + "pharetra dignissim nisi ac, vulputate lobortis turpis. "
      }
    

    produces this:
    no_item.PNG

    As you can see, the text isn't wrapping.

    Question 1: why isn't the text wrapping? I believe I have all the necessary width settings.

    If I uncomment the "Item" around the Text, I get this:
    with_item.PNG
    So, I'm getting the wrapping I want, but now I somehow need to properly set the height property of the containing ColumnLayout (I think).

    Question 2: how do I do this?

    Thanks...

    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