refs #507, added utility function toStringList

This commit is contained in:
Klaus Basan
2015-11-17 01:03:42 +01:00
committed by Mathew Sutcliffe
parent d131cd2d33
commit 348d4e2f60

View File

@@ -20,6 +20,7 @@
#include "dbus.h"
#include "icon.h"
#include <algorithm>
#include <QStringList>
namespace BlackMisc
{
@@ -169,6 +170,15 @@ namespace BlackMisc
return str += "}";
}
//! To string list
QStringList toStringList(bool i18n = false) const {
QStringList sl;
for (const T &obj : this->derived()) {
sl.append(obj.toQString(i18n));
}
return sl;
}
protected:
//! \copydoc BlackMisc::CValueObject::getMetaTypeId
int getMetaTypeId() const { return qMetaTypeId<C<T>>(); }