diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2018-11-10 23:00:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-10 23:00:34 -0800 |
commit | 6b197fde726a0fbbf657c9b972c94c21ec210689 (patch) | |
tree | c95192491d1badbd139e2ce216ef491e78a55c7e /gui/designwidget.h | |
parent | 15d9b3d3cc05656e58d01ba2f97ec92b6daaee1c (diff) | |
parent | 0a3ebfbb5b4f502e66861d3857c83b825ac34795 (diff) | |
download | nextpnr-6b197fde726a0fbbf657c9b972c94c21ec210689.tar.gz nextpnr-6b197fde726a0fbbf657c9b972c94c21ec210689.tar.bz2 nextpnr-6b197fde726a0fbbf657c9b972c94c21ec210689.zip |
Merge pull request #93 from YosysHQ/gui_changes
Gui changes
Diffstat (limited to 'gui/designwidget.h')
-rw-r--r-- | gui/designwidget.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/gui/designwidget.h b/gui/designwidget.h index 0248d2c7..89c6e702 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,11 +66,14 @@ 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);
+ void clearAllSelectionModels();
Q_SIGNALS:
void selected(std::vector<DecalXY> decal, bool keep);
void highlight(std::vector<DecalXY> decal, int group);
@@ -78,12 +82,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 +99,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 +114,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 +130,7 @@ class DesignWidget : public QWidget QString currentSearch;
QList<QModelIndex> currentSearchIndexes;
int currentIndex;
+ int currentIndexTab;
};
NEXTPNR_NAMESPACE_END
|