SingleInstanceWindow.qml 937 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import QtQuick
  2. import QtQuick.Controls
  3. import QtQuick.Layouts
  4. import FluentUI
  5. FluWindow {
  6. id:window
  7. title:"SingleInstance"
  8. width: 500
  9. height: 600
  10. minimumWidth: 500
  11. minimumHeight: 600
  12. maximumWidth: 500
  13. maximumHeight: 600
  14. launchMode: FluWindow.SingleInstance
  15. FluAppBar{
  16. id:appbar
  17. title:"SingleInstance"
  18. width:parent.width
  19. }
  20. FluTextBox{
  21. anchors{
  22. top:parent.top
  23. topMargin:60
  24. horizontalCenter: parent.horizontalCenter
  25. }
  26. }
  27. FluText{
  28. wrapMode: Text.WrapAnywhere
  29. anchors{
  30. left: parent.left
  31. right: parent.right
  32. leftMargin: 20
  33. rightMargin: 20
  34. verticalCenter: parent.verticalCenter
  35. }
  36. text:"我是一个SingleInstance模式的窗口,如果我存在,我会销毁之前的窗口,并创建一个新窗口"
  37. }
  38. }