QML登录界面
2024-09-08 07:07:30
import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.3
ApplicationWindow {
id: root
visible: true
width: Screen.width
height: Screen.height
title: qsTr("登录雷达作战系统")
Component.onCompleted: {
root.visibility = Window.Maximized
}
Image {
anchors.fill: parent
source: "qrc:/img/earth.jpg"
} Item {
width:
height:
anchors.centerIn: parent
//一个圆形图片
Item {
width: parent.width
height: parent.height
Image {
id: rdJpg
anchors.centerIn: parent
smooth: true
visible: false
source: "qrc:/img/rd.jpg"
}
Rectangle {
id: mask
width: parent.width
height: parent.height
radius: width/
visible: false
}
OpacityMask {
anchors.fill: parent
source: rdJpg
maskSource: mask
}
} //用户输入
Item {
width:
height:
anchors.bottom: parent.bottom
anchors.bottomMargin:
anchors.horizontalCenter: parent.horizontalCenter GridLayout {
id: grid
rows:
columns:
width:
height:
columnSpacing:
Text {
text: qsTr("用户名")
font.pointSize:
color: "black"
}
TextField {
id: filedUsr
Layout.preferredHeight:
}
Text {
text: qsTr("密码")
font.pointSize:
color: "black"
}
TextField {
id: filedPawd
Layout.preferredHeight:
}
} //登录按钮
Rectangle {
id: logBtn
width:
height:
color: "#6facf9"
radius:
border.width:
border.color: "black"
Text {
color: "#ffffff"
text: qsTr("登录")
anchors.centerIn: parent
font.pointSize:
}
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: grid.bottom
anchors.topMargin: MouseArea {
anchors.fill: parent
hoverEnabled: true
onEntered: {
logBtn.color = "#333333"
}
onPressed: {
logBtn.color = "#111111"
}
onReleased: {
logBtn.color = "#333333"
} onExited: {
logBtn.color = "#6facf9"
}
}
}
} } }
最新文章
- java分解质因数
- 使用html5 canvas绘制圆形或弧线
- MySQL查询优化:查询慢原因和解决技巧
- RESTheart安装与设置
- 漫步支持向量机(svm)之一
- 第23章 COM和ActiveX(COM可以实现跨进程跨机器的函数调用)
- DJANTO之FORM
- CentOS编译安装LNMP环境
- JVM总结之GC
- A start job is running for xxx to stop
- Oracle--新建用户以及赋予的权限
- CSS 左右两边底部对齐
- ASP.NET Core 防止跨站请求伪造(XSRF/CSRF)攻击 (转载)
- BZOJ1266 AHOI2006上学路线(最短路+最小割)
- 《Android进阶之光》--RxJava实现RxBus
- C# Linq删除父级的同时删除子级
- shell和shell脚本基本知识
- ELF文件加载与动态链接(二)
- 分析redis key大小的几种方法
- 【Golang】幽灵变量(变量覆盖)问题的一劳永逸解决方法