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:
parent
4630f41f6a
commit
6b720050ef
6 changed files with 101 additions and 0 deletions
15
tests/pysidetest/testview.cpp
Normal file
15
tests/pysidetest/testview.cpp
Normal 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;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue