Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Last line of text is cropped
Forum Updated to NodeBB v4.3 + New Features

Last line of text is cropped

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 4 Posters 935 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.
  • D Offline
    D Offline
    Devoo
    wrote on last edited by Devoo
    #1

    Hi,
    I have built simple application for embedded linux and I have problem with last line of text that is sometimes cropped by scaling.
    I noticed that problem doesn't appear on Windows with external GPU.

    Simple code:

    Text {
            anchors.top: parent.top
            anchors.left: parent.left
            width: 400
            font.pixelSize: 24
            color: 'white'
            wrapMode: Text.WordWrap
            fontSizeMode: Text.HorizontalFit 
            text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam. Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus, sed posuere libero dui id orci."
        }
    

    Have You any idea how to fix it?

    1 Reply Last reply
    0
    • Shrinidhi UpadhyayaS Offline
      Shrinidhi UpadhyayaS Offline
      Shrinidhi Upadhyaya
      wrote on last edited by
      #2

      Hi @Devoo , you can use the property called elide and for that you need to set the height also.

      Here is the sample code:-

         Text {
              width: parent.width / 2
              height: 100 
              font.pixelSize: 24
              color: 'red'
              wrapMode: Text.Wrap
              elide: Text.ElideRight
              fontSizeMode: Text.HorizontalFit
              text: "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Proin nibh augue, suscipit a, scelerisque sed, lacinia in, mi. Cras vel lorem. Etiam pellentesque aliquet tellus. Phasellus pharetra nulla ac diam. Quisque semper justo at risus. Donec venenatis, turpis vel hendrerit interdum, dui ligula ultricies purus, sed posuere libero dui id orci."
      }
      

      Shrinidhi Upadhyaya.
      Upvote the answer(s) that helped you to solve the issue.

      1 Reply Last reply
      1
      • D Offline
        D Offline
        Devoo
        wrote on last edited by
        #3

        I think You mean full line of text.
        I mean exactly one row of pixels, like here:
        alt text

        We have 2 'g' but only one character is correct.

        1 Reply Last reply
        0
        • Shrinidhi UpadhyayaS Offline
          Shrinidhi UpadhyayaS Offline
          Shrinidhi Upadhyaya
          wrote on last edited by
          #4

          Hi @Devoo , i did not get you can actually,the problem for you was that last line of text was getting cropped right or is the character "g" which is making a problem for you?

          Shrinidhi Upadhyaya.
          Upvote the answer(s) that helped you to solve the issue.

          1 Reply Last reply
          1
          • D Offline
            D Offline
            Devoo
            wrote on last edited by
            #5

            Only character 'g' is making a problem for me.

            1 Reply Last reply
            0
            • Shrinidhi UpadhyayaS Offline
              Shrinidhi UpadhyayaS Offline
              Shrinidhi Upadhyaya
              wrote on last edited by
              #6

              Hi @Devoo , is it possible attach an image or a screenshot, so that i can get better understanding

              Shrinidhi Upadhyaya.
              Upvote the answer(s) that helped you to solve the issue.

              1 Reply Last reply
              1
              • A Offline
                A Offline
                Akhil Menon
                wrote on last edited by Akhil Menon
                #7

                Hello all,

                I don't see the cropping issue !

                0_1553070460406_Screenshot from 2019-03-20 13-53-50.png

                But i have enclosed the Text inside a Rectangle !

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

                  Hi @Devoo
                  Did you get the solution ?
                  If yes please mark the thread as Solved

                  Or you can have a look into padding properyty.

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

                  1 Reply Last reply
                  1

                  • Login

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