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. QML Text Element multi line spacing
Forum Updated to NodeBB v4.3 + New Features

QML Text Element multi line spacing

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 4.9k 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.
  • DonCoderD Offline
    DonCoderD Offline
    DonCoder
    wrote on last edited by
    #1

    I am using Text element with maximum line count as 2. Can someone please tell me how to extend space between two lines

    J.HilkJ 1 Reply Last reply
    0
    • DonCoderD DonCoder

      I am using Text element with maximum line count as 2. Can someone please tell me how to extend space between two lines

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @DonCoder
      hi, havn't changed that yet, but I would guess the lineHeight : real property is what you want to modifiy. Keep in mind, its a miltuplier by default, set to 1.0 if you con't change lineHeightMode


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • Pradeep P NP Offline
        Pradeep P NP Offline
        Pradeep P N
        wrote on last edited by
        #3

        @DonCoder
        @J-Hilk solution is proper

        Label {
            anchors.centerIn: parent
            width: parent.width / 2
            text: 'space between lines'
            wrapMode: Text.WordWrap
            font.pixelSize: 20
            Rectangle { anchors.fill: parent; color: 'transparent'; border.color: 'black' }
            Component.onCompleted: console.log(lineHeight)
            lineHeight: 2
        }
        

        0_1525066332946_5d13ab7a-833d-4407-b1e8-50138e8a0475-image.png
        0_1525066354144_795ce59a-aaf0-4b1f-9412-0c1774b3849c-image.png

        Pradeep Nimbalkar.
        Upvote the answer(s) that helped you to solve the issue...
        Keep code clean.

        1 Reply Last reply
        2

        • Login

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