Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.8.0
-
None
-
qt 6.8.0,Qt Creator 15.0.0
Description
When using the virtual keyboard in the Qt control, the candidate word area fails to display above the virtual keyboard (outside the keyboard area). The candidate word area only appears when it is set to display below the virtual keyboard (within the keyboard area). When the candidate word area is configured to display above the virtual keyboard (outside the keyboard area), it only partially appears (showing a segment equal to the width of the key) when the letter keys above are clicked. I have adjusted the z-value of the ListView to ensure it is displayed on top.
//Src: keyboard.qml ListView { id: wordCandidateView objectName: "wordCandidateView" clip: false z: 2 property bool empty: true readonly property bool visibleCondition: (((!wordCandidateView.empty || wordCandidateViewAutoHideTimer.running) && InputContext.inputEngine.wordCandidateListVisibleHint) ||VirtualKeyboardSettings.wordCandidateList.alwaysVisible) && keyboard.active onVisibleConditionChanged: { console.log("visibleCondition changed:", visibleCondition); } readonly property real visibleYOffset: -height readonly property real currentYOffset: visibleCondition ? visibleYOffset : 0 height: style ? style.selectionListHeight : 0 onHeightChanged: { console.log("wordCandidateView new height:", height); } anchors.left: parent.left anchors.right: parent.right spacing: 0 orientation: ListView.Horizontal snapMode: ListView.SnapToItem delegate: style.selectionListDelegate highlight: style.selectionListHighlight ? style.selectionListHighlight : defaultHighlight highlightMoveDuration: 0 highlightResizeDuration: 0 add: !keyboard.noAnimations ? style.selectionListAdd : null remove: !keyboard.noAnimations ? style.selectionListRemove : null y:wordCandidateView.visibleYOffset //change init location make it up to down Component.onCompleted: { console.log("wordCandidateView finished initializing, visibleCondition =", visibleCondition); console.log("wordCandidateView count:",wordCandidateView.model.count); console.log("wordCandidateView model:", wordCandidateView.model); console.log("wordCandidateView height:", height); console.log("wordCandidateView y:", y); console.log("visibleYOffset:", visibleYOffset); } keyNavigationWraps: true model: InputContext.inputEngine.wordCandidateListModel onCurrentItemChanged: if (currentItem) soundEffect.register(currentItem.soundEffect) Connections { target: wordCandidateView.model ? wordCandidateView.model : null function onActiveItemChanged(index) { wordCandidateView.currentIndex = index } function onItemSelected() { if (wordCandidateView.currentItem) soundEffect.play(wordCandidateView.currentItem.soundEffect) } function onCountChanged() { console.log("wordCandidateView model.count:", wordCandidateView.model.count); var empty = wordCandidateView.model.count === 0 if (empty) wordCandidateViewAutoHideTimer.restart() else wordCandidateViewAutoHideTimer.stop() wordCandidateView.empty = empty keyboard.hideWordCandidateContextMenu() } } Connections { target: InputContext.priv function onInputItemChanged() { wordCandidateViewAutoHideTimer.stop() } } Connections { target: InputContext.inputEngine function onWordCandidateListVisibleHintChanged() { wordCandidateViewAutoHideTimer.stop() } } Timer { id: wordCandidateViewAutoHideTimer interval: VirtualKeyboardSettings.wordCandidateList.autoHideDelay } Loader { sourceComponent: style.selectionListBackground anchors.fill: parent z: -2 } Component { id: defaultHighlight Item {} } states: [ State { name: "visible" when: wordCandidateView.visibleCondition PropertyChanges { target: wordCandidateView y:0 } }, State { name: "alwaysVisible" when: keyboard.fullScreenMode || VirtualKeyboardSettings.wordCandidateList.alwaysVisible PropertyChanges { target: wordCandidateView y: wordCandidateView.visibleYOffset } } ] transitions: Transition { id: wordCandidateViewTransition from: "" to: "visible" enabled: true reversible: true onRunningChanged: { if (running) { console.log("[DEBUG] Transition to 'visible' state started111."); } else { console.log("[DEBUG] Transition to 'visible' state ended. Current y:", wordCandidateView.y); } } ParallelAnimation { NumberAnimation { properties: "y" duration: 250 easing.type: Easing.InOutQuad } } } function longPressItem(index) { return keyboard.showWordCandidateContextMenu(index) } }