aboutsummaryrefslogtreecommitdiffstats
path: root/gui/designwidget.h
diff options
context:
space:
mode:
authorSerge Bazanski <serge@bazanski.pl>2018-07-15 21:57:42 +0100
committerSerge Bazanski <serge@bazanski.pl>2018-07-15 21:57:42 +0100
commitf3c6c76fff90d89dd65af2c02124c098dab63892 (patch)
tree48aad4eb072d9972a5a1c298c9fde7922038d74d /gui/designwidget.h
parent91db413c60c965b6b7cc095f53c8d03a1658566e (diff)
parent5531546d6bcf188c27449b6256108c6c722b5b5b (diff)
downloadnextpnr-f3c6c76fff90d89dd65af2c02124c098dab63892.tar.gz
nextpnr-f3c6c76fff90d89dd65af2c02124c098dab63892.tar.bz2
nextpnr-f3c6c76fff90d89dd65af2c02124c098dab63892.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr into q3k/lock-2-electric-boogaloo
Diffstat (limited to 'gui/designwidget.h')
-rw-r--r--gui/designwidget.h41
1 files changed, 37 insertions, 4 deletions
diff --git a/gui/designwidget.h b/gui/designwidget.h
index 618c7bbf..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,17 +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 prepareMenuProperty(const QPoint &pos);
+ void prepareMenuTree(const QPoint &pos);
void onItemSelectionChanged();
- void selectObject();
+ void onItemDoubleClicked(QTreeWidgetItem *item, int column);
public Q_SLOTS:
void newContext(Context *ctx);
void updateTree();
@@ -67,6 +91,12 @@ 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;
@@ -74,6 +104,9 @@ class DesignWidget : public QWidget
QAction *actionPrev;
QAction *actionNext;
QAction *actionLast;
+
+ QColor highlightColors[8];
+ QMap<QTreeWidgetItem *, int> highlightSelected;
};
NEXTPNR_NAMESPACE_END