diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-12-17 19:37:35 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:48:01 -0300 |
commit | 7771798cf27896c43054699c5f53468cd8bf14cf (patch) | |
tree | 1115cf02ac1b8c88ee14d24fca96c17d2831f44c /tests/pysidetest/testview.h | |
parent | 05d011ccfa3ad442adb3639f9db87d49dd346299 (diff) |
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>
Diffstat (limited to 'tests/pysidetest/testview.h')
-rw-r--r-- | tests/pysidetest/testview.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/pysidetest/testview.h b/tests/pysidetest/testview.h index 1a65ea459..76a6f00f5 100644 --- a/tests/pysidetest/testview.h +++ b/tests/pysidetest/testview.h @@ -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 |