#include "ISelectComboxItem.h"
//#include <QHBoxLayout>
#include <QDebug>

ISelectComboxItem::ISelectComboxItem(std::shared_ptr<ISelectBox> box, QLabel* label)
    : m_pSelectBox(box), m_pDisplayLabel(label)
{

}

void ISelectComboxItem::setCurrentIndex(int idx)
{
    if (m_pSelectBox->isEnabled())
        m_pSelectBox->setCurrentIndex(idx);
}

int ISelectComboxItem::findData(const QVariant& value, int role)
{
    return m_pSelectBox->findData(value, role);
}

int ISelectComboxItem::findText(const QString& text)
{
    return m_pSelectBox->findText(text);
}

void ISelectComboxItem::insertItem(const QString& text, const QVariant& userData)
{
    m_pSelectBox->insertItem(text, userData);
}

void ISelectComboxItem::removeItem(int index)
{
    m_pSelectBox->removeItem(index);
}

QVariant ISelectComboxItem::currentData(int role) const
{
    return m_pSelectBox->currentData();
}

int ISelectComboxItem::count() const
{
    return m_pSelectBox->count();
}

void ISelectComboxItem::clear()
{
    m_pSelectBox->clear();
}

std::shared_ptr<ISelectBox> ISelectComboxItem::getSelectBox() const
{
    return m_pSelectBox;
}

std::list<QVariant> ISelectComboxItem::getDataList() const
{
    return m_pSelectBox->getDataList();
}
