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
23
tests/pysidetest/testview.h
Normal file
23
tests/pysidetest/testview.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef TESTVIEW_H
|
||||
#define TESTVIEW_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QAbstractListModel>
|
||||
#ifdef pysidetest_EXPORTS
|
||||
#define PYSIDE_EXPORTS 1
|
||||
#endif
|
||||
#include "pysidemacros.h"
|
||||
|
||||
class PYSIDE_API TestView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestView(QAbstractListModel* model, QObject* parent = 0) : QObject(parent), m_model(model) {}
|
||||
QAbstractListModel* model() { return m_model; }
|
||||
QObject* getData();
|
||||
private:
|
||||
QAbstractListModel* m_model;
|
||||
};
|
||||
|
||||
#endif // TESTVIEW_H
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue