automatic formatting of try-catch
-
I use Qt Creator 4.12.4 on Windows 10.
When I type:
try
Qt Creator brings up a pop-up menu where the first item is "try{}catch(){}". When I select this item, Qt Creator automatically adds the following code:
try { } catch () { }
Is it possible to change the settings so the code would be:
try { } catch () { }
?
I was unable to find any setting for doing that in the "C++" part of the "Options - Qt Creator" dialog.
-
Hi @dave2,
Actually there are two items, the second one
try and catch
is a snippet, so you can adjust it: Tools > Options > Text Editor > Snippets > C++The first one
try {} catch () {}
seems to come from Clang and can not be changed, AFAIK.Regards
-
Use an automatic styler when saving the file (e.g. beautifier plugin) and don't worry about the formatting anymore.
-
Hi @dave2,
Actually there are two items, the second one
try and catch
is a snippet, so you can adjust it: Tools > Options > Text Editor > Snippets > C++The first one
try {} catch () {}
seems to come from Clang and can not be changed, AFAIK.Regards