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

Autocomplete switch on enumeration type

    XMLWordPrintable

Details

    • feefe3585f94c2a9fad1f0445f4e95fe64d7b7eb (qt-creator/qt-creator/master)

    Description

      It would be a handy autocomplete feature to automatically populate a switch tree with case values when the switch argument is an enumeration type. For instance, if I have defined:

      enum MyEnum { eZero = 0, eOne, eTwo, eThree, eFour };
      MyEnum enumVar;
      

      And I wrote

      switch(enumVar)
      

      QtCreator would generate the following tree for me:

      switch(enumVar)
      {
      case eZero:
        break;
      case eOne:
        break;
      case eTwo:
        break;
      case eThree:
        break;
      case eFour:
        break;
      default:
        break;
      }
      

      Thanks for an awesome tool!

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-5379
          # Subject Branch Project Status CR V

          Activity

            People

              kandeler Christian Kandeler
              dlonie David Lonie
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes