2023-08-24 15:50:37 +08:00
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Window
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import FluentUI
|
2024-01-25 17:26:50 +08:00
|
|
|
|
import "../component"
|
2023-08-24 15:50:37 +08:00
|
|
|
|
|
|
|
|
|
FluScrollablePage{
|
|
|
|
|
|
|
|
|
|
property string password: ""
|
|
|
|
|
property var loginPageRegister: registerForWindowResult("/login")
|
|
|
|
|
|
2024-03-09 15:35:48 +08:00
|
|
|
|
title: qsTr("MultiWindow")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
|
|
|
|
|
Connections{
|
|
|
|
|
target: loginPageRegister
|
|
|
|
|
function onResult(data)
|
|
|
|
|
{
|
|
|
|
|
password = data.password
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-08-24 15:50:37 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +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-08-24 15:50:37 +08:00
|
|
|
|
textFormat: Text.RichText
|
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +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-08-24 15:50:37 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/singleInstanceWindow")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CodeExpander{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: -1
|
|
|
|
|
code:'FluWindow{
|
|
|
|
|
//launchMode: FluWindowType.Standard
|
|
|
|
|
//launchMode: FluWindowType.SingleTask
|
|
|
|
|
launchMode: FluWindowType.SingleInstance
|
|
|
|
|
}
|
|
|
|
|
'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FluArea{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: 100
|
|
|
|
|
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("Create the window without carrying any parameters")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/about")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CodeExpander{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: -1
|
|
|
|
|
code:'FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
FluApp.navigate("/about")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluArea{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
height: 130
|
|
|
|
|
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("Create a window with the parameter username: zhuzichu")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
}
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
loginPageRegister.launch({username:"zhuzichu"})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
FluText{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text:qsTr("Login Window Returned Password - >")+password
|
2023-08-24 15:50:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
CodeExpander{
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.topMargin: -1
|
|
|
|
|
code:'property var loginPageRegister: registerForWindowResult("/login")
|
|
|
|
|
|
|
|
|
|
Connections{
|
|
|
|
|
target: loginPageRegister
|
|
|
|
|
function onResult(data)
|
|
|
|
|
{
|
|
|
|
|
password = data.password
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluButton{
|
2024-03-09 15:35:48 +08:00
|
|
|
|
text: qsTr("Create Window")
|
2023-08-24 15:50:37 +08:00
|
|
|
|
onClicked: {
|
|
|
|
|
loginPageRegister.launch({username:"zhuzichu"})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|