[solved]Boundaries of TextInput



  • How can clip off the text that is outside of a LineInput?

    Currently, when I type too much, the beginning of the input is moved outside on the left side:

    Screenshot:
    "http://i.imgur.com/bleVSeB.png":http://i.imgur.com/bleVSeB.png

    I would like the text on the left side to be clipped off instead. How can I do that?

    Relevant code:
    @
    Item {
    property alias text: input.text
    property alias maximumLength: input.maximumLength
    width: 180; height: 28
    TextInput {
    id: input
    color: "black"
    font.pixelSize: 16; font.bold: true
    anchors.centerIn: parent
    width: parent.width-16
    focus: true
    }
    }
    @



  • Ah, finally figured it out, TextInput has a property named clip that has to be set to true


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.