Solved How to use the tilde character ("~") in a text macro in Qt Creator?
-
I would like to create the text macros "\~english" and "\~german" for use in Doxygen comments (used for language switching).
I was able to create macros, but they appear without the tilde, i.e. "\english". When I record the macro with two backslashes, I get "\\english". With two tildes, I get "\english".
Is there any way to preserve the tilde in the macro?
-
Try this,
Tested example.!
-
Your Text Editing Macros works fine for me! I'm on Ubuntu 16.04 x64, QtCreator 4.5.0 based on Qt 5.10.
Which platform are you using?
-
This post is deleted! -
@yuvaram I guess @Robert-Hairgrove means Creators "Text Editing Macros" function (in the Tools menu).
Or am I wrong, Robert?
-
Thanks for the suggestions. However, I am not talking about C++ macros, but editing macros used while typing code in Qt Creator.
I want to use these within comment blocks which are used by Doxygen to generate documentation of the source code. C++ macros are not expanded within comment blocks.
-
@aha_1980 -- Thank you, this is correct!
I am using Qt Creator 4.2.1 based on Qt 5.8.0 (also on Ubuntu 16.04 LTS).Should I upgrade my Qt installation?
-
Should I upgrade my Qt installation?
(Can only speak for myself): I would upgrade Creator.
-
In the meantime, it seems to be a problem with dead keys in my current keyboard layout (German/Swiss). I cannot enter any characters into a macro which are produced by pressing a dead key followed by the space bar.
As a workaround, I think I shall set up macros with a substitute character instead of the tilde and then do a global search and replace at the end of the day.
Thank you for all the suggestions!
-
maybe you can edit an recorded macro? in the end, it must be stored somewhere... (cannot check now, have only the phone)
-
@aha_1980 - I tried finding it with grep ... no luck, though. Probably easier just to do search & replace.
-
Continuation is here: QTCREATORBUG-20890
-
@aha_1980 - Thanks for posting the follow-up!
-
@Robert-Hairgrove I had a Déjà-vu when I read the bugreport :)