From 5d5324c073a2795689410a2baabff5cd1f0ff9a8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 20 Oct 2018 15:15:23 +0200 Subject: Split tree models and make other features work with it --- gui/designwidget.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 0248d2c7..1859ed12 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -21,6 +21,7 @@ #define DESIGNWIDGET_H #include +#include #include #include #include "nextpnr.h" @@ -65,9 +66,11 @@ class DesignWidget : public QWidget const ElementType &type = ElementType::NONE); QString getElementTypeName(ElementType type); ElementType getElementTypeByName(QString type); + TreeModel::Model *getTreeByElementType(ElementType type); + int getIndexByElementType(ElementType type); int getElementIndex(ElementType type); void updateButtons(); - void addToHistory(QModelIndex item); + void addToHistory(int tab, QModelIndex item); std::vector getDecals(ElementType type, IdString value); void updateHighlightGroup(QList item, int group); Q_SIGNALS: @@ -78,12 +81,12 @@ class DesignWidget : public QWidget private Q_SLOTS: void prepareMenuProperty(const QPoint &pos); - void prepareMenuTree(const QPoint &pos); - void onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + void prepareMenuTree(int num, const QPoint &pos); + void onSelectionChanged(int num, const QItemSelection &selected, const QItemSelection &deselected); void onItemDoubleClicked(QTreeWidgetItem *item, int column); void onDoubleClicked(const QModelIndex &index); void onSearchInserted(); - void onHoverIndexChanged(QModelIndex index); + void onHoverIndexChanged(int num, QModelIndex index); void onHoverPropertyChanged(QtBrowserItem *item); public Q_SLOTS: void newContext(Context *ctx); @@ -95,9 +98,11 @@ class DesignWidget : public QWidget private: Context *ctx; - TreeView *treeView; - QItemSelectionModel *selectionModel; - TreeModel::Model *treeModel; + QTabWidget *tabWidget; + + TreeView *treeView[6]; + QItemSelectionModel *selectionModel[6]; + TreeModel::Model *treeModel[6]; QLineEdit *searchEdit; QtVariantPropertyManager *variantManager; QtVariantPropertyManager *readOnlyManager; @@ -108,7 +113,7 @@ class DesignWidget : public QWidget QMap propertyToId; QMap idToProperty; - std::vector history; + std::vector> history; int history_index; bool history_ignore; @@ -124,6 +129,7 @@ class DesignWidget : public QWidget QString currentSearch; QList currentSearchIndexes; int currentIndex; + int currentIndexTab; }; NEXTPNR_NAMESPACE_END -- cgit v1.2.3 From d08fe2109dcb7e037d4321f9804a5c0aeca3b87b Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 21 Oct 2018 13:19:44 +0200 Subject: clangformat --- gui/designwidget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index 1859ed12..f27eced2 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -113,7 +113,7 @@ class DesignWidget : public QWidget QMap propertyToId; QMap idToProperty; - std::vector> history; + std::vector> history; int history_index; bool history_ignore; -- cgit v1.2.3 From 02edd66ae9494e0323e618747eeb0d38f0df75d4 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Mon, 29 Oct 2018 19:39:52 +0100 Subject: Changes to cover issues from code review --- gui/designwidget.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gui/designwidget.h') diff --git a/gui/designwidget.h b/gui/designwidget.h index f27eced2..89c6e702 100644 --- a/gui/designwidget.h +++ b/gui/designwidget.h @@ -73,6 +73,7 @@ class DesignWidget : public QWidget void addToHistory(int tab, QModelIndex item); std::vector getDecals(ElementType type, IdString value); void updateHighlightGroup(QList item, int group); + void clearAllSelectionModels(); Q_SIGNALS: void selected(std::vector decal, bool keep); void highlight(std::vector decal, int group); -- cgit v1.2.3