QT 登录界面实现 QML方式
登录界面实现
效果图
代码
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
//import QtQuick.Controls 1.4
//import QtQuick.Controls.Styles 1.4
Window {
id: rocket
width: 1920
height: 1081
visible: true
flags: Qt.FramelessWindowHint
Rectangle{
Image {
id:leadbar
x: 0
y: 0
width: 1920
height: 92
source: "qrc:/img/leaderbar.png"
}
}
Button {
id: btn
x: 1830
y: 0
width: 90
height: 92
Image {
id: name11
// anchors.fill: parent
// source: "qrc:/img/close_pressed.png"
source: {
if(btn.pressed){
"qrc:/img/close_pressed.png"
}
else if(btn.hovered){
"qrc:/img/close_hover.png"
}
else{