mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +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 "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>>(); }
|
||||
|
||||
Reference in New Issue
Block a user