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

QTime displayed as QDateTime in QTreeWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.0.0 Beta 1
    • 4.7.1
    • Widgets: Itemviews
    • None
    • Windows 7
    • c3e1abad4e141e6e9d876e5cff194c473a2654eb

    Description

      This is a regression from Qt 4.7.0. When creating an editable QTreeWidgetItem with a QTime based variant in a QTreeWidget, then the item is correctly displayed as QTime. After editing the value however, the item is displayed as QDateTime instead of QTime. In Qt 4.7.0 and earlier versions the item will be correctly displayed as QTime.

      The following example reproduces the problem:

      #include <QtGui>
      
      class TreeWidget : public QTreeWidget
      {
      public:
      	TreeWidget()
      	{
      		QTreeWidgetItem *firstItem = new QTreeWidgetItem();
      		firstItem->setData(0, Qt::DisplayRole, QTime(20,00));
      	
      		firstItem->setFlags(firstItem->flags() | Qt::ItemIsEditable);
      		QTreeWidgetItem *secondItem = new QTreeWidgetItem();
      		secondItem->setText(0,"Second item");
      		addTopLevelItem(firstItem);
      		addTopLevelItem(secondItem);
      	}
      
      };
      
      int main(int argc, char** argv)
      {
      	QApplication app(argc, argv);
      	TreeWidget window;
      	window.show();
      	return app.exec();
      
      }

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            naevdal Sigrid Fjell Nævdal (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes