好久都没有正经的更新自己的文章了,这段时间也辞职了,听了小爱的,准备买个碗,自己当老板,下面请欣赏效果图

这个界面布局就是自己是在想不到啥了,按照常规汽车导航的布局布局了一下,主要看内容哈,看看这个文本文件

问个文本文件的状态了有一下三种

1. 正常 normal

2. 激活 active

3. 不可用 enable

位置可以有一下方式组合

1. 上

2. 下

3. 左

4. 右

5. 中心

等等,自己组合了就不写了

颜色目前默认是写了绿色,用了一些军事上面的颜色 。大家可以自行更改

下面附上文本文件的源代码

import QtQuick 2.0

/*
作者:张建伟
日期:2018年3月28日
简述:这是一个针对UFCP专门自定义的一个Text文本显示控件,该模块只适用于某种特定软件开发
*/ Item { property string textState: "normal" //声明一个属性,用来表示当前文本的状态,/*激活:active*/ /*正常:normal*/ /*不可用:enable*/
property string textDetails: "测试文本" //声明一个属性,用来表示文本内容
property string textPositionH: "center" //声明一个属性,用来表示水平位置布局 /*左:left*/ /*右:right*/ /*中:center*/
property string textPositionV: "center" //声明一个属性,用来表示垂直位置布局 /*上: top*/ /*下:bottom*/ /*中:center*/
width: 200 //默认宽度
height: 96 //默认高度 Rectangle //用来显示文本的背景颜色
{
id: background
width: m_Text.width < 200 ? m_Text.width : 200
height: m_Text.height
color:
{ /*
颜色根据文本不同的状态显示不同的颜色
*/ if(textState == "active")
{
"#00FF00"
}
else
{
"#0000FF00"
}
} Text {
id: m_Text
color:
{ /*
文本颜色根据文本状态显示不同颜色
*/ if(textState == "active")
{
"#000000"
}
else if(textState == "normal")
{
"#00FF00"
}
else
{
"#c0c0c0"
}
}
font.pixelSize: 20 //字体大小20像素
font.family: "微软雅黑" //字体 微软雅黑
font.bold: false //关闭粗体显示
anchors.centerIn: parent
text: qsTr(textDetails) //文本显示内容
} /*
文字布局,根据实际需求调整文本布局
*/ anchors.top:
{
if(textPositionV == "top")
{
parent.top
}
}
anchors.bottom:
{
if(textPositionV == "bottom")
{
parent.bottom
}
}
anchors.left:
{
if(textPositionH == "left")
{
parent.left
}
}
anchors.right:
{
if(textPositionH == "right")
{
parent.right
}
}
anchors.centerIn:
{
if(textPositionH == "center" && textPositionV == "center")
{
parent.Center
}
} anchors.horizontalCenter:
{
if(textPositionH == "center")
{
parent.horizontalCenter
}
}
anchors.verticalCenter:
{
if(textPositionV == "center")
{
parent.verticalCenter
}
} } }

最新文章

  1. AutoMapper搬运工之初探AutoMapper
  2. PHP 获取js中变量的方法
  3. 服务控件与html标签的一点
  4. 判断DAG图
  5. poj1163The Triangle(简单DP)
  6. mybatis generator 插件安装及使用
  7. .NET Core2.0+MVC 用Redis/Memory+cookie实现的sso单点登录
  8. 四十二、在线预览pdf文件
  9. javascript+html5+canvse+3d俄罗斯方块
  10. mysql基本操作(一)
  11. c#中@标志的作用 C#通过序列化实现深表复制 细说并发编程-TPL 大数据量下DataTable To List效率对比 【转载】C#工具类:实现文件操作File的工具类 异步多线程 Async .net 多线程 Thread ThreadPool Task .Net 反射学习
  12. 注解 和 xml 配置的优缺点【转】
  13. 计算机网络七层协议模型 “开放系统互联参考模型”,即著名的OSI/RM模型(Open System Interconnection/Reference Model)
  14. 551. Student Attendance Record I + Student Attendance Record II
  15. week13《java程序设计》第13次作业总结
  16. 20165202 2017-2018-2 《Java程序设计》第9周学习总结
  17. SSZipArchive使用详解
  18. Updated: Database Partitioning with EBS Whitepaper
  19. java中使用MD5进行加密
  20. 常用MS-SQL写法整理

热门文章

  1. 理解基本包装类型Number,String,Boolean
  2. C# 实现Excel读取接口写入数据
  3. Jmeter--thrift接口压测
  4. 关于session序列化和session钝化和活化
  5. 爬虫之Beautifulsoup及xpath
  6. Unity 游戏框架搭建 (二十三) 重构小工具 Platform
  7. NDK-C++ support
  8. Git单人本地仓库操作
  9. Jboot使用appassembler-maven-plugin插件生成启动脚本
  10. ubuntu14.04安装qt-4.8.4