diff options
Diffstat (limited to 'editor/tool.cc')
-rw-r--r-- | editor/tool.cc | 11 |
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(); |