Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-1832

Quickfix for introducing a local variable from selection / expression under cursor

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • Qt Creator 2.1.0
    • Qt Creator 2.0.0
    • Editors
    • None
    • any

    Description

      Just having evaluated Qt Creator 2.0.0 I was happy to find my suggestions for [Ctrl][Alt][Up] (create copy of current code line above current line) and [Ctrl][Alt][Down] (copy current line below) working! :-D

      Being able to use them now made me realize, that I miss these closely related ones, too: [Alt][Up] and [Alt][Down].
      They should move the selected line(s) up and down which is quite useful in combination with the above ones.

      Another nice Eclipse shortcut is: [Alt][Shift][L]. In Eclipse this shortcut generates a local variable for the expression before the cursor or the selected expression and inserts that variable. To example it, consider this code:
      void a_method() {
      callToAnotherMethod(QRect(0,0,30,30)*);
      }

      In Eclipse, when the cursor is where I placed the * symbol above and I active the shortcut, a dialog shows up asking for the name of the local variable. Let's say I would enter "rect" and press ok, then Eclipse's JDK would convert the code from above to:

      void a_method() {
      QRect rect(0,0,30,30);
      callToAnotherMethod(rect);
      }

      When evaluating the Nokia Qt SDK and writing my first Qt mobile app I had many situations, where I wished Qt Creator would know about [Alt][Shift][L], too.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            erikv Erik Verbruggen
            robert.wloch Robert Wloch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes