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. [SOLVED] QML: calculate size for Rectangle from child Text content
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QML: calculate size for Rectangle from child Text content

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 15.1k 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.
  • A Offline
    A Offline
    AcerExtensa
    wrote on last edited by
    #1

    Hello,
    I'm pretty new to QML and have following problem:
    I have some Rectangle element with the Text element inside of it. Text of Text element is dynamic and wrapped by the rectangle width, font size is also dynamic. The problem is: I need to resize my rectangle by height so what the whole text content will fit in it. Is where any methods, functions, properties for that?

    God is Real unless explicitly declared as Integer.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      Ups, found in the docu: "Text.paintedHeight":http://qt-project.org/doc/qt-4.8/qml-text.html#paintedHeight-prop is exactly what i need

      God is Real unless explicitly declared as Integer.

      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