Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Tip: 'Enclose in QLatin1String'

    Tools
    3
    6
    2929
    Loading More Posts
    • 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.
    • M
      mario last edited by

      This 'refactoring' tool saved me a lot of typing today. It will wrap your string with a QLatin1String().

      Right click on a char string and choose 'Refactor/Enclose in QLatin1String', that's it.

      1 Reply Last reply Reply Quote 0
      • A
        andre last edited by

        Even easier: use the Alt-Enter shortcut for this. Saves taking off your hands from the keyboard and a few mouse clicks.

        1 Reply Last reply Reply Quote 0
        • M
          mario last edited by

          Damn, I refuse, it's too easy :)

          Hmm, where did you find out about 'Alt-Enter'?

          Is the shortcut "context sensitive refactoring tools"?

          1 Reply Last reply Reply Quote 0
          • F
            frankcyblogic.de last edited by

            If it gets easier, even monkeys can do code;) I still refuse to use QLatin1String, because I'm expecting UTF-8 everywhere.

            1 Reply Last reply Reply Quote 0
            • A
              andre last edited by

              [quote author="mario" date="1302854298"]Damn, I refuse, it's too easy :)

              Hmm, where did you find out about 'Alt-Enter'?

              Is the shortcut "context sensitive refactoring tools"?[/quote]

              I learned about it in a conversation in a "topic":http://developer.qt.nokia.com/forums/viewthread/4382/ here with Tobias, and it is the shortcut for what the Qt Creator team refers to as a C++ Quick Fix operation.

              1 Reply Last reply Reply Quote 0
              • M
                mario last edited by

                Andre: Thanks for the link to the conversation, good read.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post