Code condensed in editor



  • I'm working in Qt editor 4.2.1 on a mac and have inadvertently done something to condense several lines of code into a small rectangular box displaying an ellipsis. The same blunder also simultaneously condensed additional distal lines of code into a rectangle box displaying an ellipsis and a curly right bracket ( ...} ) When I hover the mouse cursor over either rectangle(s), I can see the code, but not interact with it. After spending quite a bit of time searching for what might have happened, my best guess is that I may have somehow "folded" a block, but I am not sure. The documentation page on this (http://doc.qt.io/qtcreator/creator-highlighting.html) suggests that I display some folding markers by going to tools > options > text editor > behavior > display folding markers, however under my tools menu, there is no "options" option. So I'm a bit stuck, and of course, I may be on the wrong remedy trail altogether. I would be most grateful to learn how to fix this and also to know, if possible, how I fell into this problem in the first place so that I may avoid it in the future. Also, is there some setting, perhaps in the preferences, that I might configure to have my tools options available? Many thanks in advance.


  • Moderators

    Hi! Do you mean "condensed" like this?

    If yes, you can do a left-mouse-click on that rectangle with the braces and the three dots or you can click on the small arrow-head (right next to the "18" in the pic). Also see Tools > Options > Environment > Keyboard, and search for "fold" and "unfold" to find out what the corresponding keyboard shortcuts are set to.



  • Here on Linux I have menu item Edit -> Advanced -> Fold/Unfold/Toggle fold all. Clicking that small triangle/arrowhead on the left side of the text is a standard feature of many code editors AFAIK.



  • First of all, I have to give this forum an A+ on responsiveness. Both of my cries for help have evoked immediate assistance, so thank you all once more. I did manage to wriggle out of my bind by closing the project and re-opening, however I'm still a bit perplexed as to what it was that I encountered? Am I correct that this is means of hiding sections of code so as to make the remainder more readable? If so, I can see the benefit of that. Still I have no idea what it was that triggered the situation. Wieland, yes!, that rectangular box is what I was dealing with, although with just the ellipsis and not the curly brackets (except in the second case). I did not have the triangle to the left though, and there was no "Options" present under the Tools menu, which is certainly odd. A left mouse click on the rectangle itself produced no response, and a right mouse click produced a pop-up menu, however there were no choices on that menu that appeared relevant to the situation. Eeli K, thank you! I did find that sequence of choices on my menu and I will apply them to become familiar. Just out of curiosity, on your Linux version, do have an "options" under the tools menu.? Perhaps that condition is unique to the mac software. In any event, it does appear to be a deviation from the documentation.


  • Lifetime Qt Champion

    Hi,

    On macOS it's under Preferences in the Qt Creator menu.

    You have likely used the shortcut for folding accidentally.



  • @SGaist Thanks! That about settles it then! Closing this out.


Log in to reply
 

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