#ifndef COMBODATA_H #define COMBODATA_H #include #include #include "core_global.h" #include "data/comboitem.h" class CORESHARED_EXPORT ComboData { public: ComboData(const QVariant &index, const QString &label); ComboData(const QSharedPointer &index); ~ComboData(); QVariant index() const; void setIndex(const QVariant &index); QString label() const; void setLabel(const QString &label); template static QList createComboData(QList > list) { QList data; foreach (QSharedPointer item, list) { QSharedPointer qObj = qSharedPointerDynamicCast(item); if (!qObj.isNull()) { data << ComboData(qObj); } } return data; } private: QVariant m_index; QString m_label; }; #endif // COMBODATA_H