Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-72361

Add LowerCase letters to Qt::Key enumerator.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Do
    • P4: Low
    • None
    • None
    • None
    • Linux/X11

    Description

      (Sorry for the poor code formatting. Whatever tool this is, it keeps deleting my line breaks, changing text randomly to "unknown macro", and placing curly braces in weird places. )

      consider the following code:

      const QMetaEnum &keyEnum = QMetaEnum::fromType<Qt::Key>();
      QTextStream(stdout) << keyEnum.valueToKey(getchar()) << endl;
      

      The only thing you do not really see in this code is that getchar() from <stdio.h> no longer waits for a newline before pushing on its integer to me. That being achieved though, I have been able to start building a curses-esque type of library. This means I can do things like 

      switch(ch) { case Key_Escape: endProgram(); }
      

      As getchar() is accurately interpreted by your enumerator, even on my highly modified layout. What is missing however are the lower case letters, and my request is that they should be added so I can nicely reference them in switch statements, and for debugging purposes using 

      QMetaEnum.valueToKey

      Attachments

        Issue Links

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

          Activity

            People

              cnn Qt Core & Network
              akiva Akiva Avraham
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes