Skip to content

Commit 69a8f3a

Browse files
author
Matthias Koefferlein
committed
Preparations for 0.30.
1 parent 12b3cd0 commit 69a8f3a

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

Changelog.Debian

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
klayout (0.30.0-1) unstable; urgency=low
2+
3+
* New features and bugfixes
4+
- See changelog
5+
6+
-- Matthias Köfferlein <[email protected]> Tue, 25 Mar 2025 00:00:00 +0100
7+
18
klayout (0.29.12-1) unstable; urgency=low
29

310
* New features and bugfixes

src/tl/tl/tlHash.h

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@
3434
#include <functional>
3535
#include <stdint.h>
3636

37+
// for std::hash of QString and QByteArray
38+
#if defined(HAVE_QT)
39+
# include <QString>
40+
# include <QByteArray>
41+
#endif
42+
3743
#include "tlSList.h"
3844

3945
/**
@@ -342,6 +348,60 @@ namespace std
342348
}
343349
};
344350

351+
#if defined(HAVE_QT) && QT_VERSION < 0x050000
352+
353+
/**
354+
* @brief Generic hash for QString
355+
*/
356+
357+
template <>
358+
size_t hfunc (const QString &o, size_t h)
359+
{
360+
return hfunc_iterable (o, h);
361+
}
362+
363+
template <>
364+
size_t hfunc (const QString &o)
365+
{
366+
return hfunc (o, size_t (0));
367+
}
368+
369+
template <>
370+
struct hash <QString>
371+
{
372+
size_t operator() (const QString &o) const
373+
{
374+
return hfunc (o);
375+
}
376+
};
377+
378+
/**
379+
* @brief Generic hash for QByteArray
380+
*/
381+
382+
template <>
383+
size_t hfunc (const QByteArray &o, size_t h)
384+
{
385+
return hfunc_iterable (o, h);
386+
}
387+
388+
template <>
389+
size_t hfunc (const QByteArray &o)
390+
{
391+
return hfunc (o, size_t (0));
392+
}
393+
394+
template <>
395+
struct hash <QByteArray>
396+
{
397+
size_t operator() (const QString &o) const
398+
{
399+
return hfunc (o);
400+
}
401+
};
402+
403+
#endif
404+
345405
}
346406

347407
#endif

0 commit comments

Comments
 (0)