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. Set a maximum width for a child Rectangle
Forum Updated to NodeBB v4.3 + New Features

Set a maximum width for a child Rectangle

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 548 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.
  • Y Offline
    Y Offline
    Yazid10
    wrote on last edited by
    #1

    2 Rectangles, child and parent.
    The child rectangle dynamically changes its width when typing text ( I am using a TextEdit) while the parent rectangle has a constant width value. The issue is when I'm writing a long sentence in TextEdit area, the width of child rectangle exceeds the border of the parent rectangle. I used the wrapMode but it didn't fix it

    Is there any way to set a maximum width for the child so it can stay inside the parent rectangle ?

    sierdzioS 1 Reply Last reply
    0
    • Y Yazid10

      2 Rectangles, child and parent.
      The child rectangle dynamically changes its width when typing text ( I am using a TextEdit) while the parent rectangle has a constant width value. The issue is when I'm writing a long sentence in TextEdit area, the width of child rectangle exceeds the border of the parent rectangle. I used the wrapMode but it didn't fix it

      Is there any way to set a maximum width for the child so it can stay inside the parent rectangle ?

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Yazid10 Please show the code.

      My guess is that you have not set the width of your TextEdit component, that is why wrapping does not work. Once you bind the width to your child Rectangle it should work.

      (Z(:^

      1 Reply Last reply
      0
      • Y Yazid10 has marked this topic as solved on

      • Login

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