aboutsummaryrefslogtreecommitdiffstats
path: root/gui/designwidget.h
diff options
context:
space:
mode:
authorEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-15 19:22:57 +0000
committerEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-15 19:22:57 +0000
commit0bae7f5606b15591a23fb63da1c5ff6f93b40747 (patch)
tree7b0760fa1e5c837f9b43cf1c97fa9f55973a169b /gui/designwidget.h
parent1457a6453c11af34a73460868833a9462e987854 (diff)
parent21bf78dae9ef95e65b549c60061bce9790b1b611 (diff)
downloadnextpnr-0bae7f5606b15591a23fb63da1c5ff6f93b40747.tar.gz
nextpnr-0bae7f5606b15591a23fb63da1c5ff6f93b40747.tar.bz2
nextpnr-0bae7f5606b15591a23fb63da1c5ff6f93b40747.zip
Merge branch 'master' into 'master'
Master See merge request eddiehung/nextpnr!1
Diffstat (limited to 'gui/designwidget.h')
-rw-r--r--gui/designwidget.h49
1 files changed, 44 insertions, 5 deletions
diff --git a/gui/designwidget.h b/gui/designwidget.h
index 7785513a..1afe817d 100644
--- a/gui/designwidget.h
+++ b/gui/designwidget.h
@@ -21,6 +21,7 @@
#define DESIGNWIDGET_H
#include <QTreeWidget>
+#include <QVariant>
#include "nextpnr.h"
#include "qtgroupboxpropertybrowser.h"
#include "qtpropertymanager.h"
@@ -29,6 +30,16 @@
NEXTPNR_NAMESPACE_BEGIN
+enum class ElementType
+{
+ NONE,
+ BEL,
+ WIRE,
+ PIP,
+ NET,
+ CELL
+};
+
class DesignWidget : public QWidget
{
Q_OBJECT
@@ -38,16 +49,30 @@ class DesignWidget : public QWidget
~DesignWidget();
private:
- void addProperty(QtProperty *property, const QString &id);
void clearProperties();
-
+ QtProperty *addTopLevelProperty(const QString &id);
+ QtProperty *addSubGroup(QtProperty *topItem, const QString &name);
+ void addProperty(QtProperty *topItem, int propertyType, const QString &name, QVariant value,
+ const ElementType &type = ElementType::NONE);
+ QString getElementTypeName(ElementType type);
+ ElementType getElementTypeByName(QString type);
+ int getElementIndex(ElementType type);
+ void updateButtons();
+ void addToHistory(QTreeWidgetItem *item);
+ std::vector<DecalXY> getDecals(ElementType type, IdString value);
+ void updateHighlightGroup(QTreeWidgetItem *item, int group);
Q_SIGNALS:
void info(std::string text);
+ void selected(std::vector<DecalXY> decal);
+ void highlight(std::vector<DecalXY> decal, int group);
+ void finishContextLoad();
+ void contextLoadStatus(std::string text);
private Q_SLOTS:
- void prepareMenu(const QPoint &pos);
- void onItemClicked(QTreeWidgetItem *item, int);
- void selectObject();
+ void prepareMenuProperty(const QPoint &pos);
+ void prepareMenuTree(const QPoint &pos);
+ void onItemSelectionChanged();
+ void onItemDoubleClicked(QTreeWidgetItem *item, int column);
public Q_SLOTS:
void newContext(Context *ctx);
void updateTree();
@@ -66,8 +91,22 @@ class DesignWidget : public QWidget
QMap<QtProperty *, QString> propertyToId;
QMap<QString, QtProperty *> idToProperty;
+
+ QMap<QString, QTreeWidgetItem *> nameToItem[6];
+ std::vector<QTreeWidgetItem *> history;
+ int history_index;
+ bool history_ignore;
+
QTreeWidgetItem *nets_root;
QTreeWidgetItem *cells_root;
+
+ QAction *actionFirst;
+ QAction *actionPrev;
+ QAction *actionNext;
+ QAction *actionLast;
+
+ QColor highlightColors[8];
+ QMap<QTreeWidgetItem *, int> highlightSelected;
};
NEXTPNR_NAMESPACE_END