Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Last line of text is cropped



  • 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?



  • 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."
    }


  • 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.



  • 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?



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



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



  • 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 !



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

    Or you can have a look into padding properyty.


Log in to reply