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

QDateTimeEdit does not resize correctly after format change using `setDislayFormat`

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.11.2
    • None

    Description

      After changing the format using `setDisplayFormat`, the widget isn't resized properly.

      ```
      auto dte = new QDateTimeEdit()
      dte->setDateTimeFormat("yyyy-MM-dd hh:mm:ss"); // ok!
      ...
      dte->setDateTimeFormat("yyyy-MM-dd"); // ok! gets smaller
      ...
      dte->setDateTimeFormat("yyyy-MM-dd hh:mm:ss"); // failure! keeps small size.
      ```

      This is the `sizeHint()` for the three fictive calls above:
      ```
      288,50
      175,50
      175,50
      ```

      As you can see, the size hint gets smaller, but not larger for unknown reasons.

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            drzoom Tobias Erbsland
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes