Ejemplo n.º 1
0
    def testQTime(self):
        time = datetime.time(11, 14, 0, 1000)
        other = QTime(time)
        self.assertEqual(time.hour, other.hour())
        self.assertEqual(time.minute, other.minute())
        self.assertEqual(time.second, other.second())
        self.assertEqual(time.microsecond/1000, other.msec())

        self.assertEqual(time, other.toPython())
Ejemplo n.º 2
0
    def testQTime(self):
        time = datetime.time(11, 14, 0, 1000)
        other = QTime(time)
        self.assertEqual(time.hour, other.hour())
        self.assertEqual(time.minute, other.minute())
        self.assertEqual(time.second, other.second())
        self.assertEqual(time.microsecond/1000, other.msec())

        self.assertEqual(time, other.toPython())
Ejemplo n.º 3
0
 def fromQTimeToTime(qtime: QTime) -> time:
     return qtime.toPython()
Ejemplo n.º 4
0
 def fromQDateAndQTime(qdate: QDate, qtime: QTime):
     native_date = qdate.toPython()
     native_time = qtime.toPython()
     return datetime.combine(native_date, native_time)