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

QTime displayed as QDateTime in QTreeWidget

XMLWordPrintable

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

      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();
      
      }

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

            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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes