aboutsummaryrefslogtreecommitdiffstats
path: root/gui/designwidget.h
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-10-20 15:15:23 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-10-27 12:02:01 +0200
commit5d5324c073a2795689410a2baabff5cd1f0ff9a8 (patch)
treeb0e02ad23c0181552d510d4fbcfb69d02418e0ae /gui/designwidget.h
parent4c0db1160860e9917df1f8b9fb988d4174ed13c2 (diff)
downloadnextpnr-5d5324c073a2795689410a2baabff5cd1f0ff9a8.tar.gz
nextpnr-5d5324c073a2795689410a2baabff5cd1f0ff9a8.tar.bz2
nextpnr-5d5324c073a2795689410a2baabff5cd1f0ff9a8.zip
Split tree models and make other features work with it
Diffstat (limited to 'gui/designwidget.h')
-rw-r--r--gui/designwidget.h22
1 files changed, 14 insertions, 8 deletions
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 <QMouseEvent>
+#include <QTabWidget>
#include <QTreeView>
#include <QVariant>
#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<DecalXY> getDecals(ElementType type, IdString value);
void updateHighlightGroup(QList<TreeModel::Item *> 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<QtProperty *, QString> propertyToId;
QMap<QString, QtProperty *> idToProperty;
- std::vector<QModelIndex> history;
+ std::vector<std::pair<int,QModelIndex>> history;
int history_index;
bool history_ignore;
@@ -124,6 +129,7 @@ class DesignWidget : public QWidget
QString currentSearch;
QList<QModelIndex> currentSearchIndexes;
int currentIndex;
+ int currentIndexTab;
};
NEXTPNR_NAMESPACE_END