RibbonWindow: Fix showWindow() in Qt5.

This commit is contained in:
Mentalflow 2024-06-04 21:21:16 +08:00
parent 73a408b623
commit 840e697eb5
Signed by: Mentalflow
GPG Key ID: 5AE68D4401A2EE71
2 changed files with 8 additions and 4 deletions

View File

@ -156,6 +156,8 @@ Window {
}
function showWindow(window_url, args){
if(typeof args === "undefined")
args = {}
let sub_windows = RibbonUI.windowsSet
if (sub_windows.hasOwnProperty(window_url)&&sub_windows[window_url]['windowStatus'] !== RibbonWindow.Status.Stardard)
{
@ -181,9 +183,9 @@ Window {
sub_windows[window_url].close()
}
}
var component = Qt.createComponent(window_url, Component.PreferSynchronous, undefined);
var component = Qt.createComponent(window_url, Component.PreferSynchronous, null);
if (component.status === Component.Ready) {
var window = component.createObject(undefined, args)
var window = component.createObject(null, args)
if (!(window instanceof Window))
{
console.error("RibbonWindow: Error loading Window: Instance is not Window.")

View File

@ -155,6 +155,8 @@ Window {
}
function showWindow(window_url, args){
if(typeof args === "undefined")
args = {}
let sub_windows = RibbonUI.windowsSet
if (sub_windows.hasOwnProperty(window_url)&&sub_windows[window_url]['windowStatus'] !== RibbonWindow.Status.Stardard)
{
@ -180,9 +182,9 @@ Window {
sub_windows[window_url].close()
}
}
var component = Qt.createComponent(window_url, Component.PreferSynchronous, undefined);
var component = Qt.createComponent(window_url, Component.PreferSynchronous, null);
if (component.status === Component.Ready) {
var window = component.createObject(undefined, args)
var window = component.createObject(null, args)
if (!(window instanceof Window))
{
console.error("RibbonWindow: Error loading Window: Instance is not Window.")