Add EditControl support for wxTreeCtrl under wxQT

This commit is contained in:
Graham Dawes
2019-02-06 09:20:13 +00:00
parent cfe36f7ae7
commit 57348b4a59
3 changed files with 120 additions and 97 deletions

View File

@@ -2,6 +2,8 @@
#define _WX_TREEITEM_FACTORY_H_
#include <QtWidgets/QItemEditorFactory>
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QItemDelegate>
#include "wx/recguard.h"
#include "wx/textctrl.h"
@@ -71,6 +73,12 @@ public:
{
}
void AttachTo(QTreeWidget *tree)
{
QItemDelegate *qItemDelegate = static_cast<QItemDelegate*>(tree->itemDelegate());
qItemDelegate->setItemEditorFactory(this);
}
QWidget* createEditor(int WXUNUSED(userType), QWidget* parent) const wxOVERRIDE
{
m_textCtrl = new wxQtListTextCtrl(m_parent, parent);