#include "testdnd.h"
#include <QtOpenGL/QGLWidget>

testDnd::testDnd(QWidget *parent, Qt::WFlags flags)
    : QWidget(parent, flags)
{
    ui.setupUi(this);
    ui.verticalLayout->addWidget(new QGLWidget);

    setAcceptDrops(true);
}

testDnd::~testDnd()
{

}

void testDnd::mousePressEvent(QMouseEvent *e)
{
    QDrag *drag = new QDrag(this);
    QMimeData *mimeData = new QMimeData;
    mimeData->setText("Test Dnd");
    drag->setMimeData(mimeData);
    Qt::DropAction dropAction = drag->exec(Qt::CopyAction);
}

void testDnd::dragEnterEvent(QDragEnterEvent *e)
{
    e->acceptProposedAction();
}

