PyQt5 how to display seconds on QTableWidget
<p>I'm using A QTableWidget to display some data.</p>

<p>The problem is that my first column is a QDateTime and the QTableWidget doesn't display the seconds. 
I tried to change QDateTime to QTime and it doesn't show the second too.</p>

<p>And when i try to sort them it's not correct ( i guess it come from the first problem, it will maybe be a next question ) </p>

<p>I didn't found any solution in the Qt documentation.</p>

<pre><code>            self.widgetEvents = QtGui.QTableWidget(numberOfEvents, 4);
        self.widgetEvents.keyPressEvent = self.keyPressOnWidgetEvent;
        self.setAttribute(QtCore.Qt.WA_AcceptTouchEvents);
        self.setAttribute(QtCore.Qt.WA_NoMousePropagation);
        self.widgetEvents.contextMenuEvent = self.contextMenuEvent;

        self.widgetEvents.hide();
        self.rightPanelUi.verticalLayout.addWidget(self.widgetEvents)

        customHeader = HeaderTableView(QtCore.Qt.Horizontal, self.widgetEvents)
        customHeader.setStretchLastSection(True)
        customHeader.setHighlightSections(True)
        customHeader.setSectionsClickable(True)
        #customHeader.setSortIndicatorShown(True)

        customHeader.setContextMenuTreeWidgetCallBack(self.getDataToShowAvaillableFilters)

        customHeader.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        customHeader.customContextMenuRequested.connect(customHeader.showContextMenu)

        self.widgetEvents.setHorizontalHeader(customHeader)

        self.widgetEvents.setHorizontalHeaderLabels((_('Date'), _('Category'), _('Type'), _('Description')))

        #self.widgetEvents.horizontalHeader().sectionClicked.connect(self.sortData)
        self.widgetEvents.setSortingEnabled(True)

        self.widgetEvents.verticalHeader().setVisible(False)
        self.widgetEvents.setAlternatingRowColors(True)
        self.widgetEvents.setStyleSheet("alternate-background-color: rgb(240,240,240); background-color: white;")
        self.widgetEvents.setShowGrid(False)
        self.widgetEvents.hide();

        k = 0; # date &amp; hour
        for e in eventsLogFramesDecoded:
            itemDateTime = QTableWidgetItem()
            #strdatetime = str(e[6]) + '/' + str(e[5]) + '/' + str(2000 + int(e[4])) + ' ' +  str(e[7]) + ':' + str(e[8]) + ':' + str(e[9]);

            date = QDate(2000 + int(e[4]) ,int(e[5]), int(e[6]) )
            time = QTime(int(e[7]), int(e[8]), int(e[9]))
            #dateTime = QDateTime(date, time)
            #dateTime = QDateTime(date, time, 1)

            #itemDateTime.setData(0,strdatetime);
            #itemDateTime.setData(0,  QDateTime(date, time, 1));
            itemDateTime.setData(0, time);
            print(str(time))

            self.widgetEvents.setItem(k, 0, itemDateTime);
            k = k + 1;
</code></pre>

<p>Thank !</p>