2023-08-24 15:50:37 +08:00
|
|
|
|
import QtQuick 2.15
|
|
|
|
|
import QtQuick.Layouts 1.15
|
|
|
|
|
import QtQuick.Window 2.15
|
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
|
import FluentUI 1.0
|
2023-08-26 17:20:30 +08:00
|
|
|
|
import "../component"
|
2023-03-13 18:23:46 +08:00
|
|
|
|
|
|
|
|
|
FluScrollablePage{
|
|
|
|
|
|
2023-04-06 17:32:21 +08:00
|
|
|
|
property string password: ""
|
2023-04-22 16:02:52 +08:00
|
|
|
|
property var loginPageRegister: registerForWindowResult("/login")
|
2023-04-06 17:32:21 +08:00
|
|
|
|
|
2024-03-09 15:35:48 +08:00
|
|
|
|
title: qsTr("MultiWindow")
|
2023-03-13 21:18:51 +08:00
|
|
|
|
|
|
|
|
|
Connections{
|
|
|
|
|
target: loginPageRegister
|
|
|
|
|
function onResult(data)
|
|
|
|
|
{
|
|
|
|
|
password = data.password
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-13 18:10:38 +08:00
|
|
|
|
FluArea{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: 86
|
|
|
|
|
paddings: 10
|
|
|
|
|
Layout.topMargin: 20
|
|
|
|
|
Column{
|
|
|
|
|
spacing: 15
|
|
|
|
|
anchors{
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
}
|
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("<font color='red'>Standard</font> mode window,a new window is created every time")
|
2023-04-13 18:10:38 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-04-13 18:10:38 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/standardWindow")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluArea{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: 86
|
|
|
|
|
paddings: 10
|
|
|
|
|
Layout.topMargin: 10
|
|
|
|
|
Column{
|
|
|
|
|
spacing: 15
|
|
|
|
|
anchors{
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
}
|
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("<font color='red'>SingleTask</font> mode window,If a window exists, this activates the window")
|
2023-04-13 18:10:38 +08:00
|
|
|
|
textFormat: Text.RichText
|
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-04-13 18:10:38 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/singleTaskWindow")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluArea{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: 86
|
|
|
|
|
paddings: 10
|
|
|
|
|
Layout.topMargin: 10
|
|
|
|
|
Column{
|
|
|
|
|
spacing: 15
|
|
|
|
|
anchors{
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
}
|
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("<font color='red'>SingleInstance</font> mode window,If the window exists, destroy the window and create a new window")
|
2023-04-13 18:10:38 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-04-13 18:10:38 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/singleInstanceWindow")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CodeExpander{
|
|
|
|
|
Layout.fillWidth: true
|
2023-04-19 17:25:46 +08:00
|
|
|
|
Layout.topMargin: -1
|
2023-04-13 18:10:38 +08:00
|
|
|
|
code:'FluWindow{
|
2023-07-18 18:24:06 +08:00
|
|
|
|
//launchMode: FluWindowType.Standard
|
|
|
|
|
//launchMode: FluWindowType.SingleTask
|
|
|
|
|
launchMode: FluWindowType.SingleInstance
|
2023-04-13 18:10:38 +08:00
|
|
|
|
}
|
|
|
|
|
'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-03-13 18:23:46 +08:00
|
|
|
|
FluArea{
|
2023-04-03 09:32:06 +08:00
|
|
|
|
Layout.fillWidth: true
|
2023-03-13 21:28:35 +08:00
|
|
|
|
height: 100
|
2023-03-13 18:23:46 +08:00
|
|
|
|
paddings: 10
|
|
|
|
|
Layout.topMargin: 20
|
|
|
|
|
Column{
|
2023-03-13 21:28:35 +08:00
|
|
|
|
spacing: 15
|
2023-03-13 18:23:46 +08:00
|
|
|
|
anchors{
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
}
|
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create the window without carrying any parameters")
|
2023-03-13 18:23:46 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-03-13 18:23:46 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/about")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-06 17:32:21 +08:00
|
|
|
|
CodeExpander{
|
|
|
|
|
Layout.fillWidth: true
|
2023-04-19 17:25:46 +08:00
|
|
|
|
Layout.topMargin: -1
|
2023-04-06 17:32:21 +08:00
|
|
|
|
code:'FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-04-06 17:32:21 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/about")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
'
|
|
|
|
|
}
|
2023-03-13 18:23:46 +08:00
|
|
|
|
|
|
|
|
|
FluArea{
|
2023-04-03 09:32:06 +08:00
|
|
|
|
Layout.fillWidth: true
|
2023-03-13 21:18:51 +08:00
|
|
|
|
height: 130
|
2023-03-13 18:23:46 +08:00
|
|
|
|
paddings: 10
|
|
|
|
|
Layout.topMargin: 20
|
|
|
|
|
|
|
|
|
|
Column{
|
2023-03-13 21:18:51 +08:00
|
|
|
|
spacing: 15
|
2023-03-13 18:23:46 +08:00
|
|
|
|
anchors{
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
left: parent.left
|
|
|
|
|
}
|
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create a window with the parameter username: zhuzichu")
|
2023-03-13 18:23:46 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-03-13 18:23:46 +08:00
|
|
|
|
onClicked: {
|
2023-03-13 21:18:51 +08:00
|
|
|
|
loginPageRegister.launch({username:"zhuzichu"})
|
2023-03-13 18:23:46 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-13 21:18:51 +08:00
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text:qsTr("Login Window Returned Password - >")+password
|
2023-03-13 21:18:51 +08:00
|
|
|
|
}
|
2023-03-13 18:23:46 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-06 17:32:21 +08:00
|
|
|
|
CodeExpander{
|
|
|
|
|
Layout.fillWidth: true
|
2023-04-19 17:25:46 +08:00
|
|
|
|
Layout.topMargin: -1
|
2023-04-22 16:02:52 +08:00
|
|
|
|
code:'property var loginPageRegister: registerForWindowResult("/login")
|
2023-04-06 17:32:21 +08:00
|
|
|
|
|
|
|
|
|
Connections{
|
|
|
|
|
target: loginPageRegister
|
|
|
|
|
function onResult(data)
|
|
|
|
|
{
|
|
|
|
|
password = data.password
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-04-06 17:32:21 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
loginPageRegister.launch({username:"zhuzichu"})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
'
|
|
|
|
|
}
|
2023-03-13 18:23:46 +08:00
|
|
|
|
|
|
|
|
|
}
|