]> Creatis software - clitk.git/commitdiff
Add tip on image file name with absolute path
authorsrit <srit>
Mon, 28 Feb 2011 14:44:44 +0000 (14:44 +0000)
committersrit <srit>
Mon, 28 Feb 2011 14:44:44 +0000 (14:44 +0000)
vv/vvMainWindow.cxx

index 1c9765efbbb37983a293ffd37f72abc9768c6e0e..f62198883969d56e456f1d22e0a0a54d85b69d11 100644 (file)
@@ -821,6 +821,7 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, LoadedImageType fi
         item->setData(0,Qt::UserRole,files[i].c_str());
         QFileInfo fileinfo(imageManager->GetFileName().c_str()); //Do not show the path
         item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
+        item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
         qApp->processEvents();
 
         //Create the buttons for reload and close
@@ -1727,7 +1728,9 @@ void vvMainWindow::AddOverlayImage(int index, QString file)
     QTreeWidgetItem *item = new QTreeWidgetItem();
     item->setData(0,Qt::UserRole,file.toStdString().c_str());
     item->setData(1,Qt::UserRole,tr("overlay"));
-    item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,filename.c_str());
+    QFileInfo fileinfo(file); //Do not show the path
+    item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
+    item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
     qApp->processEvents();
 
     for (int j = 1; j <= 4; j++) {
@@ -1848,7 +1851,9 @@ void vvMainWindow::AddFusionImage(int index, QString file)
       QTreeWidgetItem *item = new QTreeWidgetItem();
       item->setData(0,Qt::UserRole,file.toStdString().c_str());
       item->setData(1,Qt::UserRole,tr("fusion"));
-      item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,filename.c_str());
+      QFileInfo fileinfo(filename.c_str()); //Do not show the path
+      item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
+      item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
       qApp->processEvents();
 
       for (int j = 1; j <= 4; j++) {
@@ -1931,7 +1936,9 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
   QTreeWidgetItem *item = new QTreeWidgetItem();
   item->setData(0,Qt::UserRole,filename.toStdString().c_str());
   item->setData(1,Qt::UserRole,tr("vector"));
-  item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,filename);
+  QFileInfo fileinfo(filename); //Do not show the path
+  item->setData(COLUMN_IMAGE_NAME,Qt::DisplayRole,fileinfo.fileName());
+  item->setToolTip(COLUMN_IMAGE_NAME,fileinfo.absoluteFilePath());
   qApp->processEvents();
 
   for (int j = 1; j <= 4; j++) {