Added test for Python written models returning new objects without keeping reference to them.

Reviewed by Lauro Moura <lauro.neto@openbossa.org>
eviewed by Luciano Wolf <luciano.wolf@openbossa.org>
This commit is contained in:
Marcelo Lira 2010-12-13 17:47:16 -03:00
commit 6b720050ef
6 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#include "testview.h"
#include <QDebug>
#include <stdio.h>
QObject*
TestView::getData()
{
QModelIndex index;
QVariant data = m_model->data(index);
QObject* obj = 0;
if (data.canConvert<QObject*>())
obj = data.value<QObject*>();
return obj;
}