summaryrefslogtreecommitdiff
path: root/editor/tool.cc
diff options
context:
space:
mode:
authordeva <deva>2008-07-07 07:36:42 +0000
committerdeva <deva>2008-07-07 07:36:42 +0000
commit12bd3e7ff088b097bf4e280161aee646fbbb50dc (patch)
treec8923c3b73fe578c95d45f99e6bcc36dbe2e72f5 /editor/tool.cc
parent678aba4c1fd1c9930ecda84a126f1bc7163dc29d (diff)
Made actual widgets get dragged around
Diffstat (limited to 'editor/tool.cc')
-rw-r--r--editor/tool.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/editor/tool.cc b/editor/tool.cc
index 4a40c47..b9ed07d 100644
--- a/editor/tool.cc
+++ b/editor/tool.cc
@@ -28,6 +28,9 @@
#include <QDrag>
//#include <QMimeType>
+#include "widgetwrapper.h"
+#include "macrowindow.h"
+#include "widget.h"
Tool::Tool(QPixmap &pixmap, QString widget)
: QLabel()
@@ -46,7 +49,13 @@ void Tool::mousePressEvent(QMouseEvent *event)
drag->setPixmap(pixmap);
QMimeData *mimedata = new QMimeData();
- mimedata->setData("pracro/widget", widget.toAscii());
+ if(widget == "vertical") {
+ mimedata->setData("pracro/widget", wrapWidget(new MacroWindow( Qt::Vertical)));
+ } else if(widget == "horizontal") {
+ mimedata->setData("pracro/widget", wrapWidget(new MacroWindow( Qt::Horizontal)));
+ } else {
+ mimedata->setData("pracro/widget", wrapWidget(new Widget(widget.toAscii())));
+ }
drag->setMimeData(mimedata);
drag->exec();