Fixes bug #502.
The ownership of the editor returned by the Python override of QAbstractItemDelegate.createEditor(...) is now transferred to C++. A test was added to simulate the situation that triggers the bug, instead of relying on an example with a view, model and editable cells. See: http://bugs.openbossa.org/show_bug.cgi?id=502 Reviewed by Lauro Moura <lauro.neto@openbossa.org> Reviewed by Renato Araújo <renato.filho@openbossa.org>
This commit is contained in:
parent
fbc06244e0
commit
14a5405837
6 changed files with 91 additions and 7 deletions
|
|
@ -2,12 +2,15 @@
|
|||
#define TESTVIEW_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QAbstractListModel>
|
||||
#ifdef pysidetest_EXPORTS
|
||||
#define PYSIDE_EXPORTS 1
|
||||
#endif
|
||||
#include "pysidemacros.h"
|
||||
|
||||
class QWidget;
|
||||
class QAbstractListModel;
|
||||
class QAbstractItemDelegate;
|
||||
|
||||
class PYSIDE_API TestView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -15,8 +18,13 @@ public:
|
|||
TestView(QAbstractListModel* model, QObject* parent = 0) : QObject(parent), m_model(model) {}
|
||||
QAbstractListModel* model() { return m_model; }
|
||||
QVariant getData();
|
||||
|
||||
void setItemDelegate(QAbstractItemDelegate* delegate) { m_delegate = delegate; }
|
||||
QWidget* getEditorWidgetFromItemDelegate() const;
|
||||
|
||||
private:
|
||||
QAbstractListModel* m_model;
|
||||
QAbstractItemDelegate* m_delegate;
|
||||
};
|
||||
|
||||
#endif // TESTVIEW_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue