Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Designer Does Not Support QKeySequence::StandardKey
Forum Updated to NodeBB v4.3 + New Features

Qt Designer Does Not Support QKeySequence::StandardKey

Scheduled Pinned Locked Moved Qt Creator and other tools
14 Posts 3 Posters 7.2k 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.
  • Y Offline
    Y Offline
    youarefunny
    wrote on last edited by
    #1

    As far as I can tell you can't do it unless you set it from your code. I hope I'm wrong. As if you want to move your app from platform to platform it sucks.

    As the documentation says.

    bq. As a result, both human-readable strings and hard-coded key codes can both be problematic to use when specifying a key sequence that can be used on a variety of different keyboard layouts. Only the use of standard shortcuts guarantees that the user will be able to use the shortcuts that the developer intended.

    bq. It is preferable to use standard shortcuts where possible. When creating key sequences for non-standard shortcuts, you should use human-readable strings in preference to hard-coded integer values.

    I think that this needs to be fixed. It makes perfect sense to me why you want native shortcuts.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      I am not sure I understand the problem?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on last edited by
        #3

        @Andre: that unfortunately the Action editor doesn't allow you to specify a QKeySequence::StandardKey, but only to type in your shortcut (like inputting "Ctrl+A", which is not truly cross platform).

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Ah, ok, I get it. There is indeed room for improvement there, I guess. Please "file":http://bugreports.qt.nokia.com a wish against QtCreator. I found that the Creator team is quite receptive to (reasonable) suggestions.

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            youarefunny
            wrote on last edited by
            #5

            Will do.

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              youarefunny
              wrote on last edited by
              #6

              Thanks for the bug tracking system. For some reason I could not find it. (even though looking back I could have just googled it). Anyway, it seems that this has been addressed and declared Wontfix. But, I noticed that they said they didn't like the proposed idea. Mabey if there was a better solution proposed...

              I was thinking that because Qt Designer uses strings to construct it's key sequences, there could be s special syntax for setting standardKeys. It appears this method lacks support for standard keys. Maybe for example if the string starts with a semicolon (or two) unless escaped some way. Then it would be useable to the string constructor/cast and therefor Qt Designer.

              But, now that I think about it, how would you cast from a standard key to a string? I guess you could give the primary one as a string.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                dangelog
                wrote on last edited by
                #7

                IMHO it just should provide a combobox with the standardkeys, or allow you to specify a custom shortcut. That's it.

                Software Engineer
                KDAB (UK) Ltd., a KDAB Group company

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  I agree, it would be best to have a combobox or something like that to select a standard key.

                  @youarefunny: do you have a link to the issue?

                  1 Reply Last reply
                  0
                  • Y Offline
                    Y Offline
                    youarefunny
                    wrote on last edited by
                    #9

                    http://bugreports.qt.nokia.com/browse/QTBUG-1278

                    There is also a link to another bug there. But there they have a getter and i think that is the problem. I think if it could be a string it could be run-time.

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #10

                      I think either the StandardKey getter patch should be accepted, or there should be a patch written for the string format interpretter to accept & return standard keys. I don't quite see why it is conceptually wrong to have a getter for a StandardKey in QKeySequence though.

                      1 Reply Last reply
                      0
                      • D Offline
                        D Offline
                        dangelog
                        wrote on last edited by
                        #11

                        Apart from that, there's no need of such a getter in order to implement the feature inside Designer (and thus uic). Just save in the .ui, along the action data, the fact that it uses a StandardKey.

                        Software Engineer
                        KDAB (UK) Ltd., a KDAB Group company

                        1 Reply Last reply
                        0
                        • Y Offline
                          Y Offline
                          youarefunny
                          wrote on last edited by
                          #12

                          The reason I see is that UI forms can be loaded run time. This means that if you want to want to use a standard key it will have to be a string anyway. Otherwise you would have a Designer only method to accomplish the same thing.

                          To me I think they are right in saying that it would be bad to have a different interface. I believe they try to keep the .ui files as close to the code as possible. As you see it is just declaring the classes specified and calling the proper functions with the strings, integers or boolean values given in the XML node and attribute values. I think that that is truly beautiful and to be preserved.

                          1 Reply Last reply
                          0
                          • D Offline
                            D Offline
                            dangelog
                            wrote on last edited by
                            #13

                            So what? How is saving
                            @<action id="foo" shortcutType="standardKey" key="Undo">@
                            inside the .ui problematic at all? (Except that it may break with old uics, but who cares?)

                            Software Engineer
                            KDAB (UK) Ltd., a KDAB Group company

                            1 Reply Last reply
                            0
                            • Y Offline
                              Y Offline
                              youarefunny
                              wrote on last edited by
                              #14

                              The thing is how to translate into a ui_*.h file. I mean it isn't really a big deal at all but it isn't direct. I personaly love it but I am just trying to be critical so that we get the best answer for the devs (and one that they hopefully won't shoot down).

                              I think that this should be attached as to a bug report as a proposed fix.

                              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