summaryrefslogtreecommitdiffstats
path: root/tools/linguist/shared/translatormessage.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linguist/shared/translatormessage.h')
-rw-r--r--tools/linguist/shared/translatormessage.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/linguist/shared/translatormessage.h b/tools/linguist/shared/translatormessage.h
index 363019e..7d31925 100644
--- a/tools/linguist/shared/translatormessage.h
+++ b/tools/linguist/shared/translatormessage.h
@@ -179,6 +179,32 @@ Q_DECLARE_TYPEINFO(TranslatorMessage, Q_MOVABLE_TYPE);
int qHash(const TranslatorMessage &msg);
+struct TranslatorMessagePtr {
+ TranslatorMessagePtr(const TranslatorMessage &tm)
+ {
+ ptr = &tm;
+ }
+
+ inline const TranslatorMessage *operator->() const
+ {
+ return ptr;
+ }
+
+ const TranslatorMessage *ptr;
+};
+
+Q_DECLARE_TYPEINFO(TranslatorMessagePtr, Q_MOVABLE_TYPE);
+
+static inline int qHash(TranslatorMessagePtr tmp)
+{
+ return qHash(*tmp.ptr);
+}
+
+static inline bool operator==(TranslatorMessagePtr tmp1, TranslatorMessagePtr tmp2)
+{
+ return *tmp1.ptr == *tmp2.ptr;
+}
+
QT_END_NAMESPACE
#endif // QT_NO_TRANSLATION