QML行编辑器TextField

来源:互联网 发布:好学近乎知 pdf 编辑:程序博客网 时间:2024/06/16 18:04

功能很简单,要求实现一个蓝、灰边圆角和红字区域

代码如下:


import QtQuick 2.3import QtQuick.Window 2.2import QtQuick.Controls 1.4import QtQuick.Controls.Styles 1.4Window {    visible: true   TextField{   textColor: "red"//指定颜色的方式和textinput不同   style: TextFieldStyle{       background: Rectangle{       color: "blue"       border.color: "gray"       radius: 5       }//设置风格为蓝底灰边,圆角       //但是TextField不能定制光标   }   }   }

效果图:


0 0
原创粉丝点击