Nice, I hope I can get this source as well :-)
One more question. Lets say I want to set all cells content to specific picture using this methode. Again its just example to figure out how exactly its working. I tryed it like this:
{
if (!index.isValid())
else if(role == Qt::DisplayRole)
{
return QVariant::fromValue(img
);
// I tryed straight return img; as well }
}
QVariant TabsModel::data ( const QModelIndex & index, int role) const
{
if (!index.isValid())
return QVariant();
else if(role == Qt::DisplayRole)
{
QPixmap img("C:/Tab/box.png");;
return QVariant::fromValue(img); // I tryed straight return img; as well
}
else return QVariant();
}
To copy to clipboard, switch view to plain text mode
There is no warning no error. but problem is when window show, there is no picture in any cell.
Bookmarks