summaryrefslogtreecommitdiff
path: root/editor/widget.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/widget.h')
-rw-r--r--editor/widget.h32
1 files changed, 27 insertions, 5 deletions
diff --git a/editor/widget.h b/editor/widget.h
index 1cb7d9e..20baef9 100644
--- a/editor/widget.h
+++ b/editor/widget.h
@@ -27,21 +27,43 @@
#ifndef __PRACRO_WIDGET_H__
#define __PRACRO_WIDGET_H__
-#include <QLabel>
+#include <QWidget>
#include <QPixmap>
#include <QMouseEvent>
+#include <QDomElement>
+#include <QPoint>
-class Widget : public QLabel {
+class Widget : public QWidget {
Q_OBJECT
public:
- Widget(QString type);
+ Widget(QDomNode &node);
+
+ QString type;
+
+ void setValue(QString name, QString value);
+
+ QDomElement elem;
protected:
void mousePressEvent(QMouseEvent *event);
+ void mouseMoveEvent(QMouseEvent *event);
+
+ void dragEnterEvent(QDragEnterEvent *event);
+ void dragLeaveEvent(QDragLeaveEvent *event);
+ void dragMoveEvent(QDragMoveEvent *event);
+ void dropEvent(QDropEvent *event);
+
+ void paintEvent(QPaintEvent *event);
private:
- QPixmap pixmap;
- QString widget;
+ bool iscontainer;
+ Qt::Orientation orientation;
+
+ QWidget *dragObject;
+ QWidget *findWidget(QPoint pos);
+
+ QWidget *widget;
+ QPoint dragStartPosition;
};
#endif/*__PRACRO_WIDGET_H__*/