Generate wxEVT_TREE_END_LABEL_EDIT when the user has finished editing an item in wxTreeCtrl

This commit is contained in:
Graham Dawes 2019-02-07 13:34:10 +00:00
parent 5aba98353c
commit d8c3a14eee

View File

@ -110,6 +110,7 @@ public:
connect(this, &QTreeWidget::itemClicked, this, &wxQTreeWidget::OnItemClicked); connect(this, &QTreeWidget::itemClicked, this, &wxQTreeWidget::OnItemClicked);
connect(this, &QTreeWidget::itemCollapsed, this, &wxQTreeWidget::OnItemCollapsed); connect(this, &QTreeWidget::itemCollapsed, this, &wxQTreeWidget::OnItemCollapsed);
connect(this, &QTreeWidget::itemExpanded, this, &wxQTreeWidget::OnItemExpanded); connect(this, &QTreeWidget::itemExpanded, this, &wxQTreeWidget::OnItemExpanded);
connect(this, &QTreeWidget::itemChanged, this, &wxQTreeWidget::OnItemChanged);
m_editorFactory.AttachTo(this); m_editorFactory.AttachTo(this);
setDragEnabled(true); setDragEnabled(true);
@ -228,6 +229,12 @@ private:
EmitEvent(expandedEvent); EmitEvent(expandedEvent);
} }
void OnItemChanged(QTreeWidgetItem *item, int WXUNUSED(column))
{
wxTreeEvent event(wxEVT_TREE_END_LABEL_EDIT, GetHandler(), wxQtConvertTreeItem(item));
EmitEvent(event);
}
virtual void dragEnterEvent(QDragEnterEvent* event) wxOVERRIDE virtual void dragEnterEvent(QDragEnterEvent* event) wxOVERRIDE
{ {
wxEventType command = (event->mouseButtons() & Qt::RightButton) wxEventType command = (event->mouseButtons() & Qt::RightButton)