editorEvent Fix

- I accidently changed the QAbstractItemModel of the argmument of the function
  into a QStandardItemModel.
This commit is contained in:
Maxime Gimeno 2015-09-22 10:11:23 +02:00
parent 4d5962a284
commit d3336372b7
2 changed files with 3 additions and 3 deletions

View File

@ -665,11 +665,10 @@ void Scene::itemChanged(Scene_item* /* item */)
this->createIndex(m_entries.size() - 1, LastColumn));
}
bool SceneDelegate::editorEvent(QEvent *event, QStandardItemModel *model,
bool SceneDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option,
const QModelIndex &index)
{
qDebug()<<"editor event";
QAbstractProxyModel* proxyModel = dynamic_cast<QAbstractProxyModel*>(model);
Q_ASSERT(proxyModel);
Scene *scene = dynamic_cast<Scene*>(proxyModel->sourceModel());

View File

@ -168,6 +168,7 @@ private Q_SLOTS:
for(int i=0; i<5; i++)
{
list<<new QStandardItem();
list.at(i)->setEditable(false);
}
for(int i=0; i<rowCount(); i++)
{
@ -202,7 +203,7 @@ public:
{
}
bool editorEvent(QEvent *event, QStandardItemModel *model,
bool editorEvent(QEvent *event, QAbstractItemModel *model,
const QStyleOptionViewItem &option,
const QModelIndex &index);
void paint(QPainter *painter, const QStyleOptionViewItem &option,