Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to use the tilde character ("~") in a text macro in Qt Creator?
Forum Updated to NodeBB v4.3 + New Features

How to use the tilde character ("~") in a text macro in Qt Creator?

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
14 Posts 3 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Robert Hairgrove
    wrote on 13 Jan 2018, 13:13 last edited by Robert Hairgrove
    #1

    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?

    A 1 Reply Last reply 13 Jan 2018, 13:32
    0
    • Y Offline
      Y Offline
      yuvaram
      wrote on 13 Jan 2018, 13:21 last edited by yuvaram
      #2

      Hi @Robert-Hairgrove

      Try this,
      Tested example.!
      0_1515849936095_688a1854-6ec9-416f-b1ed-398d94758cd7-image.png

      A 1 Reply Last reply 13 Jan 2018, 14:11
      1
      • R Robert Hairgrove
        13 Jan 2018, 13:13

        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?

        A Offline
        A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on 13 Jan 2018, 13:32 last edited by aha_1980
        #3

        Hi @Robert-Hairgrove,

        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?

        Qt has to stay free or it will die.

        Y 1 Reply Last reply 13 Jan 2018, 13:55
        1
        • A aha_1980
          13 Jan 2018, 13:32

          Hi @Robert-Hairgrove,

          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?

          Y Offline
          Y Offline
          yuvaram
          wrote on 13 Jan 2018, 13:55 last edited by
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • Y yuvaram
            13 Jan 2018, 13:21

            Hi @Robert-Hairgrove

            Try this,
            Tested example.!
            0_1515849936095_688a1854-6ec9-416f-b1ed-398d94758cd7-image.png

            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 13 Jan 2018, 14:11 last edited by
            #5

            @yuvaram I guess @Robert-Hairgrove means Creators "Text Editing Macros" function (in the Tools menu).

            Or am I wrong, Robert?

            Qt has to stay free or it will die.

            R 1 Reply Last reply 13 Jan 2018, 15:28
            0
            • R Offline
              R Offline
              Robert Hairgrove
              wrote on 13 Jan 2018, 14:33 last edited by Robert Hairgrove
              #6

              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.

              1 Reply Last reply
              0
              • A aha_1980
                13 Jan 2018, 14:11

                @yuvaram I guess @Robert-Hairgrove means Creators "Text Editing Macros" function (in the Tools menu).

                Or am I wrong, Robert?

                R Offline
                R Offline
                Robert Hairgrove
                wrote on 13 Jan 2018, 15:28 last edited by
                #7

                @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?

                A 1 Reply Last reply 13 Jan 2018, 15:38
                0
                • R Robert Hairgrove
                  13 Jan 2018, 15:28

                  @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?

                  A Offline
                  A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on 13 Jan 2018, 15:38 last edited by
                  #8

                  @Robert-Hairgrove

                  Should I upgrade my Qt installation?

                  (Can only speak for myself): I would upgrade Creator.

                  Qt has to stay free or it will die.

                  1 Reply Last reply
                  0
                  • R Offline
                    R Offline
                    Robert Hairgrove
                    wrote on 14 Jan 2018, 10:45 last edited by
                    #9

                    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!

                    A 1 Reply Last reply 14 Jan 2018, 10:54
                    1
                    • R Robert Hairgrove
                      14 Jan 2018, 10:45

                      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!

                      A Offline
                      A Offline
                      aha_1980
                      Lifetime Qt Champion
                      wrote on 14 Jan 2018, 10:54 last edited by
                      #10

                      @Robert-Hairgrove

                      maybe you can edit an recorded macro? in the end, it must be stored somewhere... (cannot check now, have only the phone)

                      Qt has to stay free or it will die.

                      R 1 Reply Last reply 15 Jan 2018, 10:32
                      0
                      • A aha_1980
                        14 Jan 2018, 10:54

                        @Robert-Hairgrove

                        maybe you can edit an recorded macro? in the end, it must be stored somewhere... (cannot check now, have only the phone)

                        R Offline
                        R Offline
                        Robert Hairgrove
                        wrote on 15 Jan 2018, 10:32 last edited by
                        #11

                        @aha_1980 - I tried finding it with grep ... no luck, though. Probably easier just to do search & replace.

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on 1 Aug 2018, 11:24 last edited by
                          #12

                          Continuation is here: QTCREATORBUG-20890

                          Qt has to stay free or it will die.

                          R 1 Reply Last reply 1 Aug 2018, 11:38
                          3
                          • A aha_1980
                            1 Aug 2018, 11:24

                            Continuation is here: QTCREATORBUG-20890

                            R Offline
                            R Offline
                            Robert Hairgrove
                            wrote on 1 Aug 2018, 11:38 last edited by
                            #13

                            @aha_1980 - Thanks for posting the follow-up!

                            A 1 Reply Last reply 1 Aug 2018, 11:47
                            1
                            • R Robert Hairgrove
                              1 Aug 2018, 11:38

                              @aha_1980 - Thanks for posting the follow-up!

                              A Offline
                              A Offline
                              aha_1980
                              Lifetime Qt Champion
                              wrote on 1 Aug 2018, 11:47 last edited by
                              #14

                              @Robert-Hairgrove I had a Déjà-vu when I read the bugreport :)

                              Qt has to stay free or it will die.

                              1 Reply Last reply
                              1

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved