Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QShortcut is language dependent!
Qt 6.11 is out! See what's new in the release blog

QShortcut is language dependent!

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alexandros
    wrote on last edited by
    #1

    I am using Ubuntu 13.04 and I am developing a program with this OS as target. At this Ubuntu release, the shortcuts I use for inside the program tend to be language dependent. If I recall correctly, this wasn't an issue at previous Ubuntu releases.

    For example, if I have this shortcut:

    @(void) new QShortcut(Qt::CTRL + Qt::Key_Q, this, SLOT(quit_program()));@

    it won't work, unless the keyboard language is set to English.

    How can I make the shortcuts language independent?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      That's strange, are you sure it's not a modification in ubuntu that might cause that ?

      Try using tr like in QShortCut's documentation do see if it improves

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alexandros
        wrote on last edited by
        #3

        Nope! That still fails miserably when I switch the language of my keyboard.

        Please notice that all these things fail:

        1. The original way I tried
        2. The way with tr()
        3. The way from the UI editor:
          !http://i.imgur.com/hJ46giz.png(Failing miserably)!

        BUT all three work fine when the language is set to English.

        Tested in my machine and a friend's of mine, both running the latest Ubuntu 13.04 stable release.

        I don't know who is to blame, but now that I think of it, this is my first test with Qt5 and QShortcut!

        Unfortunately, I immediately started using Qt5 when I switched to 13.04. So, I've no idea.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Ok then, does it work with Qt 4 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexandros
            wrote on last edited by
            #5

            Just made an Ubuntu 13.04 live USB, installed all the liqt4-* libs, compiled a previous version of my program compatible with the qt4 libs and the shortcuts work just fine using both keyboard layouts.

            Also, under Ubuntu 13.04, using programs that aren't build with Qt5 libs (like programs written in C, or in Python etc) I can use the shortcuts no matter the keyboard's language.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Then this might be a bug.

              You can check the "bugreport":bugreports.qt-project.org/issues/ system to see if there's already something about it. Otherwise you can create a new report. Maybe first ask on the mailing list

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Leon
                wrote on last edited by
                #7

                I can confirm this bug only on letter Q
                my guess? when switched on greek, pressing Q represents ";" which is not a letter and qt gets confused.

                bug reported
                https://bugreports.qt-project.org/browse/QTBUG-33182

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved