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

QLCDNumber -> QDigitalDisplay

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 7.0 (Next Major Release)
    • All

      QLCDNumber is one of the oldest classes in Qt – its roots go back to a BASIC program on the Sinclair Spectrum. While the widget provides valuable functionality, its name is misleading. Although Number implies that it only displays digits, in reality QLCDNumber can show a variety of characters (letters, spaces, colons, percent signs, minus signs, decimal points, etc.). Moreover, according to Qt’s CamelCase convention, the acronym should be written as Lcd (as seen in classes like QHttpServer, QUrl, QSsl, and others).

      I propose renaming QLCDNumber to QDigitalDisplay. To ease the transition, QLCDNumber could be kept as an alias until Qt 7.0.

      Additionally, the documentation should be updated to state that the widget “displays characters as a digital display would”, rather than implying it is limited to numbers.

      Also, some method names could be improved:

      • Rename checkOverflow() to isOverflow() to clearly indicate that it returns a Boolean value.
      • Rename the display() slot to setValue() so that it aligns with slots in other QWidget-based widgets (such as QSlider and QProgressBar) that update their value.

      In summary, renaming the class to QDigitalDisplay and updating its method names and documentation would more accurately reflect the widget’s full capabilities and align it with Qt’s naming conventions.

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            pedantichacker Boštjan Mejak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes