QML ListView 代表 z 顺序始终位于其他所有内容之上
我有一个带有自定义小部件(我称之为 PayloadOdometerRecord)的 QML ListView 作为委托。此 PayloadOdometerRecord 包含几个其他自定义小部件 (TextBox),单击这些小部件将更改状态并显示用于用户输入的键盘。
ListView 可以正常工作,直到用户单击这些 TextBox 小部件之一来显示键盘。键盘会被显示键盘的代理下方的所有代理剪裁。
在非 ListView 中使用此 TextBox 小部件时,它可以正常工作......键盘完全可见。
有谁知道为什么会发生这种情况?我的目标是拥有一个显示的全屏键盘,并且不被任何其他组件覆盖。
谢谢!
I have a QML ListView with a custom widget (I call it PayloadOdometerRecord) as a delegate. This PayloadOdometerRecord contains a couple of other custom widgets (TextBox) that when clicked will change state and display a keyboard for user input.
The ListView works correctly until the user clicks one of these TextBox widgets to display the keyboard. The keyboard gets clipped by all of the delegates below the delegate that is displaying the keyboard.
When using this TextBox widget in a non-ListView, it works correctly...the keyboard is fully visible.
Does anyone have any idea why this is happening? My goal is to have a full-screen keyboard that shows up and is not covered by any other components.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你能展示一些代码吗?你的键盘组件的父组件是什么?
Z只在兄弟姐妹之间起作用。键盘应该是根元素的子元素,并且具有比根元素的其他子元素更高的 z 值才能使其正常工作。
Can you show some code? What is the parent of your keyboard component?
Z works only between siblings. The keyboard should be a child of the root element and have a higher z value than the other children of root to make it work.
如果键盘前面还有其他组件,可以尝试将键盘
z
-属性设置为较大的值(例如1000)→ Qt 文档If there are other components in front of the keyboard, you can try to set the keyboards
z
-property to a large value (e.g. 1000) → Qt Doc