2023-04-13 18:10:38 +08:00
|
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import FluentUI
|
2023-05-17 18:15:15 +08:00
|
|
|
|
import "../component"
|
2023-04-13 18:10:38 +08:00
|
|
|
|
|
2023-05-17 18:15:15 +08:00
|
|
|
|
CustomWindow {
|
2023-04-13 18:10:38 +08:00
|
|
|
|
|
|
|
|
|
id:window
|
2023-04-22 18:08:11 +08:00
|
|
|
|
title:"SingleInstance"
|
2023-04-13 18:10:38 +08:00
|
|
|
|
width: 500
|
|
|
|
|
height: 600
|
2023-05-17 18:15:15 +08:00
|
|
|
|
fixSize: true
|
2023-04-13 18:10:38 +08:00
|
|
|
|
launchMode: FluWindow.SingleInstance
|
|
|
|
|
|
|
|
|
|
FluTextBox{
|
|
|
|
|
anchors{
|
|
|
|
|
top:parent.top
|
|
|
|
|
topMargin:60
|
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
FluText{
|
|
|
|
|
wrapMode: Text.WrapAnywhere
|
|
|
|
|
anchors{
|
|
|
|
|
left: parent.left
|
|
|
|
|
right: parent.right
|
|
|
|
|
leftMargin: 20
|
|
|
|
|
rightMargin: 20
|
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
|
}
|
|
|
|
|
text:"我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口"
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-17 18:15:15 +08:00
|
|
|
|
FluAppBar{
|
|
|
|
|
id:appbar
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: 30
|
|
|
|
|
}
|
2023-04-13 18:10:38 +08:00
|
|
|
|
}
|