QtQuick lower() 和 raise() 在 close() 正常工作时不起作用
QtQuick lower() and raise() does not work while close() works properly
我有 5 个 windows,我通过堆栈视图推送和弹出。在模拟器中,由 push 调用的新 window 应该位于顶部。然而,在我的 android 上,它生成在起始 window 后面。我尝试使用 lower() 将起始 window 设置在新的 window 后面,但没有成功
//start page
Button{myStack.push(page_2); lower()}
我也试过在完成时升级新的 window 但没有成功
//new page
Component.OnCompleted:raise()
但是 close() 可以正常工作,关闭起始页,从而使新页面可见。
//start page
Button{myStack.push(page_2); close()}
对于 lower()
Qt 文档如下
lower()
Lowers the window in the windowing system.
Requests that the window be lowered to appear below other windows.
和 raise()
raise()
Raises the window in the windowing system.
Requests that the window be raised to appear above other windows.
我的代码正确吗?为什么 close() 起作用而其他的不起作用
首先,我认为 Qt 在 Android 上不支持 multi window。仅一首window。
其次 - 您发布的甚至不是有效的 QML 代码。
第三 - 在这种情况下,您可以在单个 window 中使用堆栈视图,并将不同的 GUI 元素推送到它上面。参考documentation.
我有 5 个 windows,我通过堆栈视图推送和弹出。在模拟器中,由 push 调用的新 window 应该位于顶部。然而,在我的 android 上,它生成在起始 window 后面。我尝试使用 lower() 将起始 window 设置在新的 window 后面,但没有成功
//start page
Button{myStack.push(page_2); lower()}
我也试过在完成时升级新的 window 但没有成功
//new page
Component.OnCompleted:raise()
但是 close() 可以正常工作,关闭起始页,从而使新页面可见。
//start page
Button{myStack.push(page_2); close()}
对于 lower()
Qt 文档如下lower()
Lowers the window in the windowing system.
Requests that the window be lowered to appear below other windows.
和 raise()
raise()
Raises the window in the windowing system.
Requests that the window be raised to appear above other windows.
我的代码正确吗?为什么 close() 起作用而其他的不起作用
首先,我认为 Qt 在 Android 上不支持 multi window。仅一首window。
其次 - 您发布的甚至不是有效的 QML 代码。
第三 - 在这种情况下,您可以在单个 window 中使用堆栈视图,并将不同的 GUI 元素推送到它上面。参考documentation.