0

Как можно сделать так, чтобы в Text символы не выходили за границу ProgressBar или любого другого элемента? если символы выходят за границу они должны исчезать .

ProgressBar {
            id: progressBarDuration
            anchors.verticalCenter: controlRect.verticalCenter
            anchors.left: controlRect.left
            anchors.leftMargin: rectBackground.width / marginLeftRight
            value: 1
            width: 400
            style: touchStyle

            Text {
                anchors.verticalCenter: progressBarDuration.verticalCenter
                anchors.left: progressBarDuration.left
                anchors.leftMargin: getWidth(rectBackground.width, 10)
                anchors.right: progressBarDuration.right
                text: qsTr("texgfdshgfjdkghfdkghfdfgdsfdsslhgjfdshgjfdskjgfdshklghft")
            }
        }

1 ответ 1

2

Нужно использовать свойство elide у Text

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.