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

Qt Creator shortcut key advice



  • Being a "tidy" programmer, I find myself going into the menu Edit > Advanced > Toggle Fold All to fold my code down frequently. So it's time I assigned it a shortcut key. Being also an "indecisive" programmer, I cannot decide which shortcut to assign to it :D Folding shortcuts seem to have no consistent key presses across various IDEs.

    I'm sure you guys will be using it too and have assigned it a shortcut, so what do use and why, please? :)


  • Qt Champions 2019

    @JonB As "tidy programmer" is a rare species there is no short-cut for that I guess :-D
    And since I'm not a tidy programmer I do not have a short-cut for this. But I rarely use folding feature.



  • @jsulm said in Qt Creator shortcut key advice:

    But I rarely use folding feature.

    I don't know what to say! Folding your .cpp files down to show all methods taking up only a line or two, rather than having to page around through gobs of code, is surely a sine qua non for productive programming, and one the most vital features of modern code IDEs....


  • Lifetime Qt Champion

    Hi
    I love folding too. ever since AMOS on amiga.
    I use the Ctrl+Shift+X



  • @mrjj
    Great that I am not alone :)

    I use the Ctrl+Shift+X

    Whooa there! That sounds too "deletey-cutty" to me! I go to fold, next thing I've cut everything and the file is empty!


  • Lifetime Qt Champion

    @JonB
    I have yet to do it. but yeah if you use ctrl+x a tons then
    i can see its a risk :)



  • @mrjj
    I wish there were an IEEE or an RFC to specify what key sequences are to be used for what operations across all editors :)


  • Lifetime Qt Champion

    @JonB
    well im not sure its very used. Among 8 dev here , im the only one that thinks its a must have feature.
    To my huge surprise, a dark theme was top score. A feature i never use as it gives me headache.



  • @mrjj Lunacy! :D


  • Qt Champions 2019

    @mrjj said in Qt Creator shortcut key advice:

    dark theme

    I hate it, no idea how one can use it (not good for the eyes in my opinion).


  • Lifetime Qt Champion

    @jsulm
    Well many seem to find it visually appealing but it might actually hurt the readability of text.
    https://pubmed.ncbi.nlm.nih.gov/17510822/
    In any case, i consider it mostly a matter of taste and hope they will always keep it as
    an option in the software i use - as its an instant uninstall if no light theme.

    And when some say they think dark theme is "so modern", i just smile for myself.

    alt text


  • Moderators

    @JonB well the default for folding a single function is strg+< ctrl+<so, add a shift modifier ?


    strg is the German keyboard



  • @J-Hilk
    On my Linux/English these are designated Ctrl+< & Ctrl+>. I had not tried these before. But, try as I might, no matter what I do or do not select, these seems to simply have no effect for me when I click them? (I also tried with Ctrl+Shift+</> in case that mattered.) Am I misunderstanding how to use them?? Ubuntu. Creator 4.8.1. I have left all keyboard mappings at default.

    And while we are here, the Help states Find next F3. I have never found this works (which has disappointed me, because it is standard in other editors). I have always had to click Ctrl+F3 --- which works because it is "Find next occurrence of selected text" provided I still have the search text selected --- in order to move to the next found.

    Do either of what I have stated above work for other people?


  • Qt Champions 2019

    @JonB For me this works:
    Ctrl-< to fold
    Ctrl-Shift-< to unfold (so, basically Ctrl->)



  • @jsulm
    Yeah, what can I say? I have checked my mappings. It shows the default like I said, but pressing it just doesn't do anything. (On UK keyboard < and > are not on the same key.) And like I said F3 doesn't work either. I have gone through various iterations of Ubuntu/Creator over the years, never worked....



  • @JonB said in Qt Creator shortcut key advice:

    but pressing it just doesn't do anything

    make sure you place the mouse cursor inside de methode or on it's prototype



  • @LeLev
    It wasn't that, but your post made me go back and try again.

    This is irritatingly misleading. I think this must be different from you posters' keyboards. A UK (or US) layout has < an the top of the , key and > at the top of the . key. I'm thinking for you Euros this is not the case? (For you is there a key with < at the bottom and and > at the top? Weird!) Because it turns out that means I must click Shift as well:

    Ctrl+<    =>    Shift+Ctrl+<
    Ctrl+>    =>    Shift+Ctrl+>
    

    Never having used such a combination in any other app, I didn't realize. [I see now that @J-Hilk has changed his post for this, I hadn't noticed that.] With Shift these shortcuts now start doing something!

    It's a shame that the docs or my key bindings can't indicate this.

    So.... does that mean, for my keyboard at least, there is a separate shortcut available for Ctrl+< (maybe that's rather Ctrl+,?), since Shift+Ctrl+< is different? I'm confused...!



  • @JonB said in Qt Creator shortcut key advice:

    I must click Shift as well:

    i also must click Shift , < and > are on the same kayboard button
    if my mouse cursor in on an empty line, nothing happens but if i click inside the method code then shortcut works


Log in to reply