ormtablerow.cpp 855 Bytes
#include "ormtablerow.h"

using namespace osdev::components;

OrmTableRow::OrmTableRow()
    : m_stoData()
{

}

OrmTableRow::~OrmTableRow()
{
    m_stoData.clear();
}

void OrmTableRow::setField( QVariant vData, int column )
{
    if( -1 == column || column >= m_stoData.count() )
    {
        m_stoData.append( vData );
    }
    else if( -1 < column && column < m_stoData.count() )
    {
        m_stoData.replace( column, vData );
    }
}

QVariant OrmTableRow::getField( int column )
{
    if( -1 < column && column < m_stoData.count() )
    {
        return m_stoData.at( column );
    }
    return QVariant();
}

void OrmTableRow::setFields( QList<QVariant> values )
{
    // Replace the entire internal structure with the new list.
    m_stoData.clear();
    for( const QVariant& value : values )
    {
        m_stoData.append( value );
    }
}