Added settings for seasons and number series. Added static method
ComboData::createComboData for easier combo bindings.
This commit is contained in:
@@ -20,6 +20,20 @@ public:
|
||||
QString label() const;
|
||||
void setLabel(const QString &label);
|
||||
|
||||
template<class T>
|
||||
static QList<ComboData> createComboData(QList<QSharedPointer<T> > list) {
|
||||
QList<ComboData> data;
|
||||
foreach (QSharedPointer<T> item, list) {
|
||||
QSharedPointer<QObject> qObj = qSharedPointerDynamicCast<QObject, T>(item);
|
||||
if (!qObj.isNull())
|
||||
{
|
||||
data << ComboData(qObj);
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
private:
|
||||
QVariant m_index;
|
||||
QString m_label;
|
||||
|
||||
Reference in New Issue
Block a user