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. Undesirable auto set hot keys on buttons

Undesirable auto set hot keys on buttons

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 1.8k 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
    abarmotov
    wrote on last edited by abarmotov
    #1

    In this example output is: QKeySequence("Alt+H")
    Opensuse 42.2, qt 5.6.1
    Is it bug or i can disable this behavior ?

    int main(int argc, char *argv[])
    {
       QApplication app(argc, argv);
       QPushButton *b = new QPushButton("Hello");
       b->setShortcut(QKeySequence("Ctrl+Q"));
       QObject::connect(b, &QPushButton::clicked, [b]() {
           qDebug() << b->shortcut();
       });
       b->show();
       return app.exec();
    }
    

    But If this example builded with manually builded qt 5.6.1 from source, then it works fine: hot key is "Ctrl+Q".
    Is it some configuration in system qt to auto assign hot keys ?

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

      Hi,

      Pretty surprising indeed... What is Ctrl + H Alt + H used for in your system ?

      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
        abarmotov
        wrote on last edited by
        #3

        Hi
        Hot key "Alt+H" is nothing in my system
        "Alt+H" is set because for letter "H" in word "Hello", qt auto set this and understroke it with alt pressed.
        And if i put many buttons on form - qt try to set for all of them hot keys with "Alt"
        This is only for system qt, and i dont understand why.

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

          I didn't realise before but Alt+H looks like an accelerator. Might be a silly question but are you using "&Hello" in your code ?

          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
            abarmotov
            wrote on last edited by
            #5

            No "&Hello" in code, no any "&" symbols in any buttons name.
            But accelerator is set - that is strange.

            Same affect i see in any qt applications in suse linked with sustem qt: kcalc, system settings ...
            I guess this some sort of configuration or settings for this behavior in system, but dont know where it and why it not affected on manually build qt and app.

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

              That's something to check with the SUSE folks.

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

              A 1 Reply Last reply
              0
              • SGaistS SGaist

                That's something to check with the SUSE folks.

                A Offline
                A Offline
                abarmotov
                wrote on last edited by abarmotov
                #7

                @SGaist said in Undesirable auto set hot keys on buttons:

                That's something to check with the SUSE folks.

                maybe, but how suse can effect on qt libs and set some hot keys if they not in my code ?

                upd: tested this app on xubuntu/kubuntu 16.04 (same machine, same qt 5.6.1, same binary)
                login as xubuntu - hot key is my "Ctrl+Q" - ok
                login as kubuntu - hot key is not my "Alt-H" - not ok
                So KDE(plasma, some else) can force change my hotkeys for my buttons in my app ?
                How qt allow this ?

                upd2: found solution http://stackoverflow.com/questions/32688153/how-to-disable-automatic-mnemonics-in-a-qt-application-on-kde
                and bug is exists

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

                  Thanks for sharing your findings !

                  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

                  • Login

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