-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #952 from syyyr/fix-logging-windows-linking
qfcore: logging: Define functions in a cpp file
- Loading branch information
Showing
4 changed files
with
63 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include "log.h" | ||
NecroLog operator<<(NecroLog log, const QString &s) { return log.operator<<(s.toStdString()); } | ||
NecroLog operator<<(NecroLog log, const QDateTime &dt) { return log.operator<<(dt.toString(Qt::ISODateWithMs).toStdString()); } | ||
NecroLog operator<<(NecroLog log, const QDate &dt) { return log.operator<<(dt.toString(Qt::ISODateWithMs).toStdString()); } | ||
NecroLog operator<<(NecroLog log, const QTime &dt) { return log.operator<<(dt.toString(Qt::ISODateWithMs).toStdString()); } | ||
NecroLog operator<<(NecroLog log, const QUrl &url) { return log.operator<<(url.toString().toStdString()); } | ||
NecroLog operator<<(NecroLog log, const QStringList &sl) { | ||
QString s = '[' + sl.join(',') + ']'; | ||
return log.operator<<(s.toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QByteArray &ba) { | ||
QString s = ba.toHex(); | ||
return log.operator<<(s.toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QVariant &v) { | ||
QString s = v.toString(); | ||
return log.operator<<(s.toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const qf::core::String &s) { return log.operator<<(s.toStdString()); } | ||
NecroLog operator<<(NecroLog log, const QPoint &p) { | ||
QString s = "QPoint(%1, %2)"; | ||
return log.operator<<(s.arg(p.x()).arg(p.y()).toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QPointF &p) { | ||
QString s = "QPoint(%1, %2)"; | ||
return log.operator<<(s.arg(p.x()).arg(p.y()).toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QSize &sz) { | ||
QString s = "QSize(%1, %2)"; | ||
return log.operator<<(s.arg(sz.width()).arg(sz.height()).toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QSizeF &sz) { | ||
QString s = "QSize(%1, %2)"; | ||
return log.operator<<(s.arg(sz.width()).arg(sz.height()).toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QRect &r) { | ||
QString s = "QRect(%1, %2, %3 x %4)"; | ||
return log.operator<<(s.arg(r.x()).arg(r.y()) | ||
.arg(r.width()).arg(r.height()).toStdString()); | ||
} | ||
NecroLog operator<<(NecroLog log, const QRectF &r) { | ||
QString s = "QRect(%1, %2, %3 x %4)"; | ||
return log.operator<<(s.arg(r.x()).arg(r.y()) | ||
.arg(r.width()).arg(r.height()).toStdString()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters