diff options
Diffstat (limited to 'gui/designwidget.h')
-rw-r--r-- | gui/designwidget.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/gui/designwidget.h b/gui/designwidget.h new file mode 100644 index 00000000..e237ec6d --- /dev/null +++ b/gui/designwidget.h @@ -0,0 +1,45 @@ +#ifndef DESIGNWIDGET_H
+#define DESIGNWIDGET_H
+
+#include <QTreeWidget>
+#include "nextpnr.h"
+#include "qtpropertymanager.h"
+#include "qttreepropertybrowser.h"
+#include "qtvariantproperty.h"
+
+// FIXME
+USING_NEXTPNR_NAMESPACE
+
+class DesignWidget : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ explicit DesignWidget(Design *design, QWidget *parent = 0);
+ ~DesignWidget();
+ Design *getDesign() { return design; }
+
+ private:
+ void addProperty(QtVariantProperty *property, const QString &id);
+ void clearProperties();
+
+ private Q_SLOTS:
+ void prepareMenu(const QPoint &pos);
+ void selectObject();
+ void onItemClicked(QTreeWidgetItem *item, int);
+
+ private:
+ Design *design;
+
+ QTreeWidget *treeWidget;
+
+ QtVariantPropertyManager *variantManager;
+ QtVariantEditorFactory *variantFactory;
+ QtTreePropertyBrowser *propertyEditor;
+ QTreeWidgetItem *itemContextMenu;
+
+ QMap<QtProperty *, QString> propertyToId;
+ QMap<QString, QtVariantProperty *> idToProperty;
+};
+
+#endif // DESIGNWIDGET_H
|