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

QDateEdit/CalendarPopup(true) has incorrect sizing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4: Low
    • 6.8.1, 6.9.0 FF
    • 4.6.3, 5.15.6
    • None
    • Platform: Ubuntu lucid/GNOME, Theme: Ambiance (default), System-wide Application Font SIze: 9pt

      Other case: Windows 10
    • Linux/Other display system, Windows
    • b6ca35f65 (dev), b63615ca6 (6.8), 0a1c17114 (dev), fc96ce3a2 (6.8)

    Description

      When setting CalendarPopup to true for a QDateEdit the minimumSizeHint does not increase in width.

      This is a problem because the widget's button size increases (see screenshots) causing the date to not get enough space.

      The problem is caused by QDateTimeEdit inheriting and using QAbstractSpinBox.
      This a design flaw as it is a combobox, not a spinbox when CalendarPopup is true.

      To fix this:
      1) A QAbstractComboBox must be developed
      2) QDateTimeEdit must inherit QWidget, not QAbstractSpinBox
      3) QAbstractSpinBox or QAbstractComboBox must be applied based on the value of CalendarPopup

      The current QDateTimeEdit class is BROKEN and is based on a FLAWED DESIGN.

      Attachments

        1. Screenshot-withcal.png
          Screenshot-withcal.png
          12 kB
        2. Screenshot-withoutcal.png
          Screenshot-withoutcal.png
          13 kB
        3. sourcecode.cpp
          0.6 kB
        4. image-2023-06-13-14-05-30-767.png
          image-2023-06-13-14-05-30-767.png
          19 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-11967
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              guest2 guest2
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes