From df534fadbee8207f981cbb5549c7248a57fee7d4 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Thu, 16 Apr 2020 23:13:35 +1000 Subject: [PATCH] common: added function to convert any number to a hex string Helps with debugging. --- app/common/CMakeLists.txt | 1 + app/common/tohex.h | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/app/common/CMakeLists.txt b/app/common/CMakeLists.txt index 2b1d61727..be51fa1e8 100644 --- a/app/common/CMakeLists.txt +++ b/app/common/CMakeLists.txt @@ -45,6 +45,7 @@ set(OLIVE_SOURCES common/timelinecommon.h common/timerange.h common/timerange.cpp + common/tohex.h common/xmlutils.h common/xmlutils.cpp PARENT_SCOPE diff --git a/app/common/tohex.h b/app/common/tohex.h index 56c590ae1..3843ebf84 100644 --- a/app/common/tohex.h +++ b/app/common/tohex.h @@ -1,4 +1,16 @@ #ifndef TOHEX_H #define TOHEX_H +#include + +#include "common/define.h" + +OLIVE_NAMESPACE_ENTER + +inline QString ToHex(quint64 t) { + return QStringLiteral("%1").arg(t, 0, 16); +} + +OLIVE_NAMESPACE_EXIT + #endif // TOHEX_H