refs #403 extern templates

This commit is contained in:
Roland Winklmeier
2015-04-10 23:34:33 +02:00
parent 38b00e06b3
commit f75c81010d
10 changed files with 161 additions and 32 deletions

View File

@@ -169,7 +169,20 @@ namespace BlackMisc
size_t heapSizeOf(const QMetaObject &objectType);
//! A map converted to string
template<class K, class V> QString qmapToString(const QMap<K, V> &map);
template<class K, class V> QString qmapToString(const QMap<K, V> &map)
{
QString s;
const QString kv("%1: %2 ");
QMapIterator<K, V> i(map);
while (i.hasNext())
{
i.next();
s.append(
kv.arg(i.key()).arg(i.value())
);
}
return s.trimmed();
}
//! Bool to on/off
QString boolToOnOff(bool v, bool i18n = false);