[Qt-interest] [QtCreator] Small bugs with editor

Chrisian Gagneraud cgagneraud at techworks.ie
Sun Jul 10 15:26:39 CEST 2011


Hi there,

I just discovered a small bug qith QtCreator 2.2.1 (Running on FC15).
It concerns the editor and enums declaration.

First try to declare an enum in a header before a class definition, the 
auto-identation is then wrong:
enum TestEnum {
     TestEnum0 = 0,
             TestEnum1,
             TestEnum2
};

Declaring the same enum in the class gives the right auto-identation 
(either as you type or with Ctrl+I):
enum TestEnum {
     TestEnum0 = 0,
     TestEnum1,
     TestEnum2
};

Now, if you comment (with #if'ed 0) the enum, like this:
#if 0
enum TestEnum {
     TestEnum0 = 0,
     TestEnum1,
     TestEnum2
};
#endif

The arrow in the left margin to collapse/expand the code will appear on 
the last enum value line:
   #if 0
   enum TestEnum {
       TestEnum0 = 0,
       TestEnum1,
V     TestEnum2
    };
    #endif

Instead of the one before the first (Which works if the enum is not 
#if'ed 0):
V
   enum TestEnum {
       TestEnum0 = 0,
       TestEnum1,
       TestEnum2
    };

Last thing,  which is more a feature request: It would be nice to have 
this collapse/expand arrow in the left margin for preprocessor 
directives like #if.
What I mean is that there should be an arrow that allow to 
expand/collapse the blocks of code between the #if, #else and #endif.
The editor is capable of detecting if the blocks of code are "active" or 
not, having the collapse/expand arrow on this block would be a really 
nice feature. Even one could imagine that the "desactivated" blocks 
would be collapsed by default.

With best regards,
Chris

-- 
Christian Gagneraud,
Embedded systems engineer.
Techworks Marine
4a Park lane
Dun Laoghaire
Co. Dublin
Ireland
Tel: + 353 (0) 1 236 5990
Web: http://www.techworks.ie/



More information about the Qt-interest-old mailing list