I'll try searching the Qt example for the icon thing. I managed to get the icon along with the song name. Here's the code:
So, in the end it was pretty simple to get the icon.if (role == Qt:ecorationRole && index.column() == 0) {
QPixmap pixmap ("icon.png");
return pixmap;
}
I have decided to use QAbstractTableModel as it fits my requirements perfectly.
Actually the data from the database is already coming as a QStringList so i have to use a QList of QStringList, so i have no choice here.
But using custom delegate i think the custom drawing will only be visible to the user when it goes into edit mode. I want the custom drawing to be visible at all times. Currently the normal checkbox (using QCheckBoxRole) is visible at all times, so i just want to add custom drawing to it. But i am not sure how to draw it as it's not a real checkbox, so a normal custom delegate might not work.
Bookmarks