Shortcut depending on the language



  • Hi,

    I have a QT application with a large text, and I would like to show a 'Search' box when user clicks the system shortcut for this functionality. But this shortcuts depends on the current system language. I mean for example, in Windows + English, Search = "CRTL + F", but in Windows + Spanish, Search = "CRTL + B".

    How can I manage this issue and detect the good shorcut depending on the language? I would like to open my 'Search' box when the user presses CRTL+F (if system is in English), or when user presses CTRL+B (if system is in Spanish)

    Thanks in advance,
    Diego


  • Moderators

    @Diego-Donate
    since shortcuts can also be defined by strings you can use Qt translation capabilities



  • @raven-worx Thanks. But what I want is to use the System standar shortcut for 'Find', which depends on the system language. I don't want to create anything "mine", but use the standar functionality, is it possible?

    My application has QML, I don't use QWidgets for GUI. I have tried:

    Shortcut {
        sequence: StandardKey.Find
        context: Qt.ApplicationShortcut
        onActivated: console.log("find...")
    }
    

    But 'activated' is only called with CTRL+F (not depending on the language)


  • Moderators

    @Diego-Donate said in Shortcut depending on the language:

    But what I want is to use the System standar shortcut for 'Find', which depends on the system language

    are you sure? i (personally) haven't heard of it.
    Normally a platform has some recommendations for the standard shortcuts. But no application really has to use it. I never found a different shortcut for copy for example...

    What system are you on?



  • @raven-worx I think you are right, i am in Windows, and it seems that CTRL+F is the standar shortcut for 'Find' in Windows (not depending on the language...). Thanks a lot


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.