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

QDateTimeEdit::setDateTime should take time specification into account

XMLWordPrintable

    • All
    • 2a653fde48f7312ccd2f792d72d305061b410ae3 (qt/qtbase/dev)

      When setting a QDateTime object to a QDateTimeEdit control the latter completely ignores the time spec of the argument (as documented). Here's the suspect code:
      https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qdatetimeedit.cpp.html#246

      What any reasonable person would expect, however, is to have the date-time converted to the proper specification that was set to the edit, as this relates to the display only, not to the actual point in time. This all means that the following code:

      QDateTimeEdit edit;
      edit.setDateTime(QDateTime::currentDateTimeUtc());
      edit.setDateTime(QDateTime::currentDateTime());

       

      produces different result for the two calls to QDateTimeEdit::setDateTime, which it should not as both arguments point to the same point in time.

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

            Eddy Edward Welbourne
            kshegunov Konstantin Shegunov
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes