I have implemented data as
{
if( index.isValid() == false )
if( role == Qt::EditRole )
{
if( index.internalPointer() )
{
int parentRow = ipToRow(index.internalPointer());
return QString("Cell %3.%1.%2").
arg(index.
row()).
arg(index.
column()) .arg(parentRow);
}
return QString("Cell %1.%2").
arg(index.
row()).
arg(index.
column());
}
QVariant className::data(const QModelIndex & index, int role) const
{
if( index.isValid() == false )
return QVariant();
if( role == Qt::EditRole )
{
if( index.internalPointer() )
{
int parentRow = ipToRow(index.internalPointer());
return QString("Cell %3.%1.%2").arg(index.row()).arg(index.column())
.arg(parentRow);
}
return QString("Cell %1.%2").arg(index.row()).arg(index.column());
}
To copy to clipboard, switch view to plain text mode
and Flags() as
Qt::ItemFlags className::flags( const QModelIndex& idx ) const
{
return Qt::ItemIsEditable;
}
Qt::ItemFlags className::flags( const QModelIndex& idx ) const
{
return Qt::ItemIsEditable;
}
To copy to clipboard, switch view to plain text mode
but it did not work.
did i do something wrong...?
Bookmarks