From ee29bb41dc9c4d4dd6fc9bfd3fb9ad5cc3bd1569 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 2 Mar 2012 20:08:40 +0100 Subject: Make it possible to move mappings Move mappings by context menu. Select new parent by QComboBox with available paths, items separated by "/". Note that hell will break loose if a mapping name contains "/". Will be fixed later. Since mapping views don't have setSortingEnabled(), make SmTreeModel::addRow() sort items. This fixes a long standing bug in SmTreeModel::reparent(): Since it alters the model, newParent has to be a QPersistentModelIndex to stay consistent. --- mappingtreewidget.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mappingtreewidget.h') diff --git a/mappingtreewidget.h b/mappingtreewidget.h index 7050743..76e7585 100644 --- a/mappingtreewidget.h +++ b/mappingtreewidget.h @@ -10,11 +10,13 @@ #include #include +#include class MappingTreeView; class MappingTreeModel; class QComboBox; class QPushButton; +class QLabel; class QSortFilterProxyModel; class QStringListModel; class QAction; @@ -41,6 +43,7 @@ class MappingTreeWidget : public QWidget { void typeChanged(QString type); void editChild(); void selectionChanged(); + void moveChild(); signals: void mappingChanged(int); @@ -59,6 +62,7 @@ class MappingTreeWidget : public QWidget { QLineEdit *mEdit; QAction *mDeleteChildA; QAction *mEditChildA; + QAction *mMoveChildA; }; class MappingTreeView : public QTreeView { -- cgit v1.2.3-70-g09d2