##// END OF EJS Templates
Add qdebug operator for SqpDateTime to enable its display in a log
perrinel -
r296:c63ffe9f765e
parent child
Show More
@@ -2,6 +2,10
2 #define SCIQLOP_SQPDATETIME_H
2 #define SCIQLOP_SQPDATETIME_H
3
3
4 #include <QObject>
4 #include <QObject>
5
6 #include <QDateTime>
7 #include <QDebug>
8
5 /**
9 /**
6 * @brief The SqpDateTime struct holds the information of time parameters
10 * @brief The SqpDateTime struct holds the information of time parameters
7 */
11 */
@@ -22,6 +26,16 struct SqpDateTime {
22 }
26 }
23 };
27 };
24
28
29 inline QDebug operator<<(QDebug d, SqpDateTime obj)
30 {
31 auto tendDateTimeStart = QDateTime::fromMSecsSinceEpoch(obj.m_TStart * 1000);
32 auto tendDateTimeEnd = QDateTime::fromMSecsSinceEpoch(obj.m_TEnd * 1000);
33
34 // QDebug << "ts: " << tendDateTimeStart << " te: " << tendDateTimeEnd;
35 d << "ts: " << tendDateTimeStart << " te: " << tendDateTimeEnd;
36 return d;
37 }
38
25 // Required for using shared_ptr in signals/slots
39 // Required for using shared_ptr in signals/slots
26 Q_DECLARE_METATYPE(SqpDateTime)
40 Q_DECLARE_METATYPE(SqpDateTime)
27
41
General Comments 0
You need to be logged in to leave comments. Login now