X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=30f7da57693088207b345d4420971b291daf6858;hb=8f42f40e826ecc4cc45e08ed41cc5596da74991c;hp=6a81732949e5857d50b2acb260925c5a0a2f7b7f;hpb=ae51e9bb80bdcd9468718a9473c1e9316cef2fd5;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 6a81732..30f7da5 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -18,6 +18,7 @@ It is distributed under dual licence #include #include +#include #include #include #include "QTreePushButton.h" @@ -132,6 +133,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() { setupUi(this); // this sets up the GUI + setAcceptDrops(true); // enable to drop into the window + setDicomClient(); //Qt::WindowFlags flags = windowFlags(); @@ -816,6 +819,25 @@ void vvMainWindow::OpenRecentImage() 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 images; + for (auto const & url : mimeData->urls()) { + images.push_back(url.toLocalFile().toStdString()); + } + LoadImages(images, vvImageReader::IMAGE); +} +//------------------------------------------------------------------------------ //------------------------------------------------------------------------------