mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #507, added utility function toStringList
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d131cd2d33
commit
348d4e2f60
@@ -20,6 +20,7 @@
|
|||||||
#include "dbus.h"
|
#include "dbus.h"
|
||||||
#include "icon.h"
|
#include "icon.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
@@ -169,6 +170,15 @@ namespace BlackMisc
|
|||||||
return str += "}";
|
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:
|
protected:
|
||||||
//! \copydoc BlackMisc::CValueObject::getMetaTypeId
|
//! \copydoc BlackMisc::CValueObject::getMetaTypeId
|
||||||
int getMetaTypeId() const { return qMetaTypeId<C<T>>(); }
|
int getMetaTypeId() const { return qMetaTypeId<C<T>>(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user