import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.0

ApplicationWindow { visible: true width: 480 height: 120 title: qsTr("QML Text Field IP Address")

RowLayout {
    anchors.fill: parent
    anchors.margins: 10

    Label {
        text: "Введите IP-адрес"
    }

    TextField {
        validator: RegExpValidator {
            regExp:  /^((?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){0,3}(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$/
       }
    }
}

}

效果: c


标签:Qt C++ Python



开发PC客户端,服务于金融行业 37091473(付费咨询)
沪ICP备14050191号 Copyright © 多多指教社区(群:312125701)
Tobyyi's QtQuick Example | Powered by NoderCMS