https://bugs.kde.org/show_bug.cgi?id=457466

--- Comment #8 from Chris Holland <zrenf...@gmail.com> ---
After editing /usr/lib64/qt5/qml/org/kde/plasma/components.3/TextField.qml in
OpenSuse TW, I've noticed that `control.availableWidth` is `undefined`, which
means the width of the placeholder is undefined.

    T.TextField {
        id: control

        Rectangle {
            border.color: "yellow"
            border.width: 1
            color: "transparent"
            x: control.leftPadding
            y: control.topPadding
            width: control.availableWidth
            height: control.availableHeight
            onWidthChanged: console.log('availableWidth',
control.availableWidth)
            Component.onCompleted: console.log('availableWidth',
control.availableWidth)
        }
        ...


I assume this is suppose to be `QQC2.Control.availableWidth` right?
* https://doc.qt.io/qt-6/qml-qtquick-controls2-control.html#availableWidth-prop

Except that `QQC2.TextField` does not inherit `QQC2.Control`.
* https://doc.qt.io/qt-6/qml-qtquick-controls2-textfield.html
* https://doc.qt.io/qt-6/qml-qtquick-textinput.html
* https://doc.qt.io/qt-6/qml-qtquick-item.html
*
https://github.com/qt/qtdeclarative/blob/dev/src/quicktemplates2/qquicktextfield_p.h
*
https://github.com/qt/qtdeclarative/blob/dev/src/quick/items/qquicktextinput_p.h

Seems there was a bug introduced in the commit that added
`control.availableWidth`. Git blame:
https://invent.kde.org/frameworks/plasma-framework/-/commit/52b9c9e94aec30ff8f0a05b0cf9a84e187f6bf61
https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/213

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to