完善登录页
parent
88437b5fb9
commit
4528b5343e
|
@ -361,3 +361,6 @@ MigrationBackup/
|
|||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
cmake-build-*/
|
||||
.idea/
|
|
@ -0,0 +1,18 @@
|
|||
import QtQuick
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import FluentUI
|
||||
|
||||
Window {
|
||||
id: app
|
||||
Component.onCompleted: {
|
||||
FluApp.init(app);
|
||||
FluTheme.darkMode = FluDarkMode.System;
|
||||
FluApp.routes = {
|
||||
"/": "qrc:/AicsKnowledgeBase/qml/MainWindow.qml"
|
||||
};
|
||||
FluApp.initialRoute = "/";
|
||||
FluApp.run();
|
||||
}
|
||||
}
|
|
@ -5,124 +5,88 @@ import QtQuick.Window
|
|||
import QtQuick.Layouts
|
||||
import org.wangwenx190.FramelessHelper
|
||||
|
||||
FluWindow{
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
title: qsTr("Hello World")
|
||||
color: "transparent"
|
||||
|
||||
property alias titleVisible: title_bar.titleVisible
|
||||
property bool appBarVisible: true
|
||||
|
||||
FluAppBar {
|
||||
id: title_bar
|
||||
title: window.title
|
||||
visible: window.appBarVisible
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
darkText: lang.dark_mode
|
||||
}
|
||||
|
||||
Item{
|
||||
id:container
|
||||
anchors{
|
||||
top: title_bar.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
}
|
||||
clip: true
|
||||
}
|
||||
|
||||
FramelessHelper{
|
||||
id:framless_helper
|
||||
onReady: {
|
||||
setTitleBarItem(title_bar)
|
||||
moveWindowToDesktopCenter()
|
||||
setHitTestVisible(title_bar.minimizeButton())
|
||||
setHitTestVisible(title_bar.maximizeButton())
|
||||
setHitTestVisible(title_bar.closeButton())
|
||||
setWindowFixedSize(fixSize)
|
||||
title_bar.maximizeButton.visible = !fixSize
|
||||
if (blurBehindWindowEnabled)
|
||||
window.backgroundVisible = false
|
||||
window.show()
|
||||
}
|
||||
}
|
||||
function setHitTestVisible(com){
|
||||
framless_helper.setHitTestVisible(com)
|
||||
}
|
||||
|
||||
function setTitleBarItem(com){
|
||||
framless_helper.setTitleBarItem(com)
|
||||
}
|
||||
Row{
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
Item{
|
||||
|
||||
Rectangle {
|
||||
id: introdutcitonItem
|
||||
height: parent.height
|
||||
width: parent.width * 0.5
|
||||
color: "#f3fbff"
|
||||
|
||||
//color: "transparent"
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: "qrc:/AicsKnowledgeBase/res/login_background.webp"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Item{
|
||||
id: loginItem
|
||||
height: parent.height
|
||||
ColumnLayout {
|
||||
id: loginRect
|
||||
width: parent.width * 0.5
|
||||
FluPivot{
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
height: parent.height
|
||||
FluPivot {
|
||||
id: loginItem
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.margins: 20
|
||||
height: 200
|
||||
|
||||
FluPivotItem{
|
||||
title: "Sign in"
|
||||
contentItem:Column{
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
anchors.centerIn: parent
|
||||
|
||||
FluPivotItem {
|
||||
title: "登录"
|
||||
|
||||
contentItem: Column {
|
||||
anchors.margins: {
|
||||
top: 10
|
||||
}
|
||||
anchors.top: parent.top
|
||||
spacing: 12
|
||||
|
||||
FluTextBox{
|
||||
placeholderText: "Account"
|
||||
|
||||
FluTextBox {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
id: account
|
||||
placeholderText: "用户名"
|
||||
}
|
||||
FluPasswordBox{
|
||||
placeholderText: "Password"
|
||||
FluPasswordBox {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
id: password
|
||||
placeholderText: "密码"
|
||||
}
|
||||
Row{
|
||||
spacing: 25
|
||||
FluCheckBox{
|
||||
text: "Remember me"
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
FluCheckBox {
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
//anchors.left: parent.left
|
||||
text: "记住密码"
|
||||
}
|
||||
FluTextButton{
|
||||
text: "Forgot your password?"
|
||||
FluTextButton {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
//anchors.right: parent.right
|
||||
text: "忘记密码?"
|
||||
}
|
||||
}
|
||||
FluFilledButton{
|
||||
text: "Sign in"
|
||||
FluFilledButton {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
normalColor: "green"
|
||||
text: "登录"
|
||||
}
|
||||
}
|
||||
}
|
||||
FluPivotItem {
|
||||
title: "注册"
|
||||
// Rectangle{
|
||||
// anchors.fill: parent
|
||||
// color: "blue"
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
FluPivotItem{
|
||||
title: "Register"
|
||||
// Rectangle{
|
||||
// anchors.fill: parent
|
||||
// color: "blue"
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import FluentUI
|
||||
import org.wangwenx190.FramelessHelper
|
||||
|
||||
FluWindow {
|
||||
property bool appBarVisible: true
|
||||
|
||||
function setHitTestVisible(com) {
|
||||
framless_helper.setHitTestVisible(com)
|
||||
}
|
||||
function setTitleBarItem(com) {
|
||||
framless_helper.setTitleBarItem(com)
|
||||
}
|
||||
id: window
|
||||
//color: "transparent"
|
||||
height: 420
|
||||
title: "智能客服知识库"
|
||||
width: 640
|
||||
|
||||
FluAppBar {
|
||||
id: title_bar
|
||||
title: window.title
|
||||
visible: appBarVisible
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
}
|
||||
/*FluIconButton {
|
||||
id: refreshButton
|
||||
height: 30
|
||||
iconSize: 13
|
||||
iconSource: FluentIcons.Sync
|
||||
width: 30
|
||||
z: 8
|
||||
|
||||
onClicked: {
|
||||
showSuccess("reload")
|
||||
loader.reload()
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: title_bar.bottom
|
||||
}
|
||||
}*/
|
||||
FramelessHelper {
|
||||
id: framless_helper
|
||||
onReady: {
|
||||
setTitleBarItem(title_bar)
|
||||
moveWindowToDesktopCenter()
|
||||
setHitTestVisible(title_bar.minimizeButton())
|
||||
setHitTestVisible(title_bar.maximizeButton())
|
||||
setHitTestVisible(title_bar.closeButton())
|
||||
//setHitTestVisible(refreshButton)
|
||||
title_bar.maximizeButton.visible = true
|
||||
//if (blurBehindWindowEnabled)
|
||||
// window.backgroundVisible = false
|
||||
window.show()
|
||||
}
|
||||
}
|
||||
|
||||
/* FluRemoteLoader {
|
||||
id: loader
|
||||
anchors.fill: parent
|
||||
source: "file:///D:\\Courses\\Qt\\AicsKnowledgeBase_client\\AicsKnowledgeBase\\qml\\LoginPage.qml"
|
||||
}*/
|
||||
LoginPage {
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Basic
|
||||
import FluentUI
|
||||
Window {
|
||||
width: 640
|
||||
height: 480
|
||||
visible: true
|
||||
title: qsTr("Hello World")
|
||||
FluArea{
|
||||
Layout.fillWidth: true
|
||||
height: 68
|
||||
Layout.topMargin: 20
|
||||
paddings: 10
|
||||
|
||||
FluFilledButton{
|
||||
disabled:filled_button_switch.checked
|
||||
text:"Filled Button"
|
||||
onClicked: {}
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
left: parent.left
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
QQmlApplicationEngine engine;
|
||||
FramelessHelper::Quick::registerTypes(&engine);
|
||||
const QUrl url(u"qrc:/AicsKnowledgeBase/qml/LoginPage.qml"_qs);
|
||||
const QUrl url(u"qrc:/AicsKnowledgeBase/qml/App.qml"_qs);
|
||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
&app, [url](QObject* obj, const QUrl& objUrl) {
|
||||
if (!obj && url == objUrl)
|
||||
|
@ -37,21 +37,3 @@ int main(int argc, char* argv[])
|
|||
engine.load(url);
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//int main(int argc, char *argv[])
|
||||
//{
|
||||
// QGuiApplication app(argc, argv);
|
||||
//
|
||||
// QQmlApplicationEngine engine;
|
||||
// const QUrl url(u"qrc:/AicsKnowledgeBase/main.qml"_qs);
|
||||
// QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||
// &app, [url](QObject *obj, const QUrl &objUrl) {
|
||||
// if (!obj && url == objUrl)
|
||||
// QCoreApplication::exit(-1);
|
||||
// }, Qt::QueuedConnection);
|
||||
// engine.load(url);
|
||||
//
|
||||
// return app.exec();
|
||||
//}
|
||||
|
|
Loading…
Reference in New Issue