2016-02-11 07:30:33 +01:00
|
|
|
#include "combodata.h"
|
|
|
|
|
|
|
|
|
|
ComboData::ComboData(const QVariant &index, const QString &label)
|
|
|
|
|
{
|
|
|
|
|
m_index = index;
|
|
|
|
|
m_label = label;
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-11 12:11:32 +01:00
|
|
|
ComboData::ComboData(const QSharedPointer<QObject> &index)
|
2016-02-11 07:30:33 +01:00
|
|
|
{
|
2016-02-11 12:11:32 +01:00
|
|
|
m_index = QVariant::fromValue(index);
|
|
|
|
|
ComboItem *ci = qobject_cast<ComboItem*>(index.data());
|
|
|
|
|
|
|
|
|
|
if (ci != NULL)
|
|
|
|
|
{
|
|
|
|
|
m_label = ci->toString();
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-02-11 07:30:33 +01:00
|
|
|
|
2016-02-11 12:11:32 +01:00
|
|
|
ComboData::~ComboData()
|
|
|
|
|
{
|
2016-02-11 07:30:33 +01:00
|
|
|
}
|
2016-02-11 12:11:32 +01:00
|
|
|
|
2016-02-11 07:30:33 +01:00
|
|
|
QVariant ComboData::index() const
|
|
|
|
|
{
|
|
|
|
|
return m_index;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ComboData::setIndex(const QVariant &index)
|
|
|
|
|
{
|
|
|
|
|
m_index = index;
|
|
|
|
|
}
|
2016-02-11 12:11:32 +01:00
|
|
|
|
2016-02-11 07:30:33 +01:00
|
|
|
QString ComboData::label() const
|
|
|
|
|
{
|
|
|
|
|
return m_label;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ComboData::setLabel(const QString &label)
|
|
|
|
|
{
|
|
|
|
|
m_label = label;
|
|
|
|
|
}
|