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

add ability to declare project wide constants

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • None
    • Qt Creator 4.5.0
    • None

    Description

      We, my particular project, have been introduced to QT because a development division of the Air Force uses it. I quickly noticed that hard coded values were repeated over and over in the QML files provided to us. The merits of using named constants is so great that there is no need to entertain that debate. I am quite surprised to find that QT does not provide any explicit method to declaring constants that can be used throughout any set of QML files. In my not so humble opinion this is a major oversight.

      Please add the ability to create a QML file of constants than can be used throughout any set of QML files with a simple "include" statement.

      Please make this an integral part of the QT environment, not some funky syntax kludged on to QT.

      Please make it as consistent with C and C++ as can be done. For example:

      const unsigned int MAX_SCREEN = 480;

      const float PI = 3.1415;

      const double PI_DOUBLE = 3.1415926535;

      const char[] = "Some String";

      I would prefer to keep the C syntax of ending with a semicolon but that is not at all critical.

      Please differentiate between integer and unsigned integer. Don't take the BASIC route and ignore that distinction. This may well be important for interfacing with C/C++ functions and classes.

      Attachments

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

        Activity

          People

            con Eike Ziller
            bkelly Michael Kelly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes