From 69a8f3ac114dea218ec14e35e16dedf83e97164f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 21 Mar 2025 23:52:08 +0100 Subject: [PATCH] Preparations for 0.30. --- Changelog.Debian | 7 ++++++ src/tl/tl/tlHash.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/Changelog.Debian b/Changelog.Debian index 85f58621a..1d2c2b3c3 100644 --- a/Changelog.Debian +++ b/Changelog.Debian @@ -1,3 +1,10 @@ +klayout (0.30.0-1) unstable; urgency=low + + * New features and bugfixes + - See changelog + + -- Matthias Köfferlein Tue, 25 Mar 2025 00:00:00 +0100 + klayout (0.29.12-1) unstable; urgency=low * New features and bugfixes diff --git a/src/tl/tl/tlHash.h b/src/tl/tl/tlHash.h index d00417067..72535c511 100644 --- a/src/tl/tl/tlHash.h +++ b/src/tl/tl/tlHash.h @@ -34,6 +34,12 @@ #include #include +// for std::hash of QString and QByteArray +#if defined(HAVE_QT) +# include +# include +#endif + #include "tlSList.h" /** @@ -342,6 +348,60 @@ namespace std } }; +#if defined(HAVE_QT) && QT_VERSION < 0x050000 + + /** + * @brief Generic hash for QString + */ + + template <> + size_t hfunc (const QString &o, size_t h) + { + return hfunc_iterable (o, h); + } + + template <> + size_t hfunc (const QString &o) + { + return hfunc (o, size_t (0)); + } + + template <> + struct hash + { + size_t operator() (const QString &o) const + { + return hfunc (o); + } + }; + + /** + * @brief Generic hash for QByteArray + */ + + template <> + size_t hfunc (const QByteArray &o, size_t h) + { + return hfunc_iterable (o, h); + } + + template <> + size_t hfunc (const QByteArray &o) + { + return hfunc (o, size_t (0)); + } + + template <> + struct hash + { + size_t operator() (const QString &o) const + { + return hfunc (o); + } + }; + +#endif + } #endif