starcontrol
11th April 2008, 10:37
Hey all,
do you know, how I can access the model (subclassed from QAbstractTableModel) from my delegate class? How do I get a pointer from the delegate class to my subclassed model? I subclassed QItemDelegate for my delegate...
I tried something like this:
void SchulungsplanDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex &index) const
{
m_spModel = static_cast<SchulungsplanModel>(index.model() );
bit this does not work, because(failure message):
no matching function for call to `SchulungsplanModel::SchulungsplanModel(const QAbstractItemModel*)' 200308 SchulungsplanDelegate.cpp line 25 1207902734474 1013
do you know, how I can access the model (subclassed from QAbstractTableModel) from my delegate class? How do I get a pointer from the delegate class to my subclassed model? I subclassed QItemDelegate for my delegate...
I tried something like this:
void SchulungsplanDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex &index) const
{
m_spModel = static_cast<SchulungsplanModel>(index.model() );
bit this does not work, because(failure message):
no matching function for call to `SchulungsplanModel::SchulungsplanModel(const QAbstractItemModel*)' 200308 SchulungsplanDelegate.cpp line 25 1207902734474 1013