From: srit Date: Mon, 28 Feb 2011 14:44:44 +0000 (+0000) Subject: Add tip on image file name with absolute path X-Git-Tag: v1.2.0~227 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=31e7228948005ecc782d2a56bb8faf17a785f83e;p=clitk.git Add tip on image file name with absolute path --- diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 1c9765e..f621988 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -821,6 +821,7 @@ void vvMainWindow::LoadImages(std::vector 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++) {