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

Incorrect timezone in tooltip for item models returning QDateTime

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.11.0
    • 5.6.2
    • Widgets: Itemviews
    • None
    • ubuntu 16.04, gcc 6.3, amd64
    • c27348985d528030d2b7d69f1734a26e421172b6

    Description

      When an item model returns a QDateTime for the Qt::ToolTipRole, the tooltip text always shows the local timezone not the timezone of the QDateTime. It does not convert the time/timezone, so the tooltip displayed represents a different point in time.

      For example, in my local timezone (AEST), QLocal::toString(QDateTime) returns:
      Saturday, 27 May 2017 12:00:00 AM UTC
      but tooltip shows
      Saturday, 27 May 2017 12:00:00 AM AEST
      These times are not equal.

      In main.cpp attached the view shows the correct timezone, the tooltips show an incorrect timezone. The example might be affected by the host's regional settings.

      Attachments

        1. main_chehrlic.cpp
          2 kB
        2. main.cpp
          1 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Eddy Edward Welbourne
            seamus Seamus Boyle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes