X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=989027b962c6ffdd472aa7b59a3bebd660754fb8;hb=769d159c09a35005afb6934fae83843f0b116d36;hp=6a81732949e5857d50b2acb260925c5a0a2f7b7f;hpb=75719c377dd8aa759f32dd277cfd7b2f914ebfa8;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 6a81732..989027b 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(); @@ -383,6 +386,9 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() updateRecentlyOpenedFilesMenu(recent_files); } + //Update and get vv parameters + setVVSettings(); + // Adding all new tools (insertion in the menu) vvToolManager::GetInstance()->InsertToolsInMenu(this); vvToolManager::GetInstance()->EnableToolsInMenu(this, false); @@ -816,6 +822,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 (int i=0; iurls().size(); ++i) { + images.push_back(mimeData->urls()[i].toLocalFile().toStdString()); + } + LoadImages(images, vvImageReader::IMAGE); +} +//------------------------------------------------------------------------------ //------------------------------------------------------------------------------