#include <algorithm>
#include <QMessageBox>
+#include <QMimeData>
#include <QInputDialog>
#include <QTimer>
#include "QTreePushButton.h"
{
setupUi(this); // this sets up the GUI
+ setAcceptDrops(true); // enable to drop into the window
+
setDicomClient();
//Qt::WindowFlags flags = windowFlags();
LoadImages(images, vvImageReader::IMAGE);
}
//------------------------------------------------------------------------------
+void vvMainWindow::dragEnterEvent(QDragEnterEvent *event)
+{
+ if (event->mimeData()->hasUrls()) {
+ event->acceptProposedAction();
+ }
+}
+//------------------------------------------------------------------------------
+void vvMainWindow::dropEvent(QDropEvent *event)
+{
+ const QMimeData * mimeData = event->mimeData();
+ if (!mimeData->hasUrls())
+ return;
+ std::vector<std::string> images;
+ for (auto const & url : mimeData->urls()) {
+ images.push_back(url.toLocalFile().toStdString());
+ }
+ LoadImages(images, vvImageReader::IMAGE);
+}
+//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#include <iostream>
#include <vector>
+#include <QDropEvent>
#include "ui_vvMainWindow.h"
#include "vvMainWindowBase.h"
#include "vvToolManager.h"
void createRecentlyOpenedFilesMenu();
void updateRecentlyOpenedFilesMenu(const std::list<std::string> &files);
+ // Drag and drop event handlers
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+
private:
//variables