Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Removing language button from QtVK



  • I found some code that allows me to remove the language button from the QtVK:

    property var keyboardLayout: inputPanel.keyboard.layout
    
    
            function findChildByProperty(parent, propertyName, propertyValue, compareCb) {
                var obj = null
                if (parent === null)
                    return null
                var children = parent.children
                for (var i = 0; i < children.length; i++) {
                    obj = children[i]
                    if (obj.hasOwnProperty(propertyName)) {
                        if (compareCb !== null) {
                            if (compareCb(obj[propertyName], propertyValue))
                                break
                        } else if (obj[propertyName] === propertyValue) {
                            break
                        }
                    }
                    obj = findChildByProperty(obj, propertyName, propertyValue, compareCb)
                    if (obj)
                        break
                }
                return obj
            }
    
    
    
            onKeyboardLayoutChanged: {
                if(keyboardLayout!==""){
                    var ChangeLanguageKey= findChildByProperty(inputPanel.keyboard, "objectName", "changeLanguageKey", null)
                    if(ChangeLanguageKey){
                        ChangeLanguageKey.visible=false
                    }
                }
            }
    

    Is there still a way for me to toggle the language? For instance, could I use an index to specify the language using the VirtualKeyboardSettings.local() function or does removing this button completely remove the ability to toggle languages?



  • Oh.. turns out I should have paid closer attention in those 3'rd grade spelling courses, it's locale not local.


Log in to reply