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

"Text.leftPadding" is not available in QtQuick 2.0.



  • Why are you giving me a mistake?
    import QtQuick 2.0
    import QtQuick.Controls 2.2
    import QtQuick.Layouts 1.3
    import io.qt.awi_work_machine.backend 1.0
    import QtQuick.Controls.Material 2.0

    Item {
    Rectangle {
    id: iconRect
    width: parent.width
    height: parent.height / 3
    color: backGroundColor

        Text {
            id: icontext
            text: qsTr("\uf0c0")
            anchors.centerIn: parent
            font.pointSize: 112
            font.family: "fontawesome"
            color: mainAppColor
        }
    }
    

    ColumnLayout {
    width: parent.width
    anchors.top: iconRect.bottom
    spacing: 15
    }
    TextField {
    id: loginUsername
    placeholderText: qsTr("User name")
    Layout.preferredWidth: parent.width - 20
    Layout.alignment: Qt.AlignHCenter
    color: mainTextCOlor
    font.pointSize: 14
    font.family: "fontawesome"
    leftPadding: 30
    background: Rectangle {
    implicitWidth: 200
    implicitHeight: 50
    radius: implicitHeight / 2
    color: "transparent"

        Text {
            text: "\uf007"
            font.pointSize: 14
            font.family: "fontawesome"
            color: mainAppColor
            anchors.left: parent.left
            anchors.verticalCenter: parent.verticalCenter
            leftPadding: 10
        }
    
    
        Rectangle {
            width: parent.width - 10
            height: 1
            anchors.horizontalCenter: parent.horizontalCenter
            anchors.bottom: parent.bottom
            color: mainAppColor
    
        }
    }
    

    }
    }


  • Moderators

    @123456789
    the error clearly says what your problem is.
    The Text.leftPadding property was added in Qt 5.6. So try importing QtQuick 2.6


Log in to reply