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. Tip: 'Enclose in QLatin1String'

Tip: 'Enclose in QLatin1String'

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 3.7k 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.
  • M Offline
    M Offline
    mario
    wrote on last edited by
    #1

    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
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      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
      0
      • M Offline
        M Offline
        mario
        wrote on last edited by
        #3

        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
        0
        • frankcyblogic.deF Offline
          frankcyblogic.deF Offline
          frankcyblogic.de
          wrote on last edited by
          #4

          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
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #5

            [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
            0
            • M Offline
              M Offline
              mario
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0

              • Login

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