From: dsarrut Date: Thu, 27 May 2010 09:33:03 +0000 (+0000) Subject: add future signal "image is selected" X-Git-Tag: v1.2.0~629 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=97ff83e02ea212ec4a20c1794f75eed2576fffc7;p=clitk.git add future signal "image is selected" --- diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index a67721a..8225ece 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -540,6 +540,13 @@ vvMainWindow::~vvMainWindow() } //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +QTabWidget * vvMainWindow::GetTab() +{ + return tabWidget; +} +//------------------------------------------------------------------------------ + //------------------------------------------------------------------------------ void vvMainWindow::MergeImages() @@ -915,6 +922,7 @@ void vvMainWindow::UpdateTree() //------------------------------------------------------------------------------ void vvMainWindow::CurrentImageChanged(std::string id) { + // DD("CurrentImageChanged"); int selected = 0; for (int i = 0; i < DataTree->topLevelItemCount(); i++) { if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString().toStdString() == id) { @@ -927,6 +935,8 @@ void vvMainWindow::CurrentImageChanged(std::string id) } DataTree->topLevelItem(selected)->setSelected(1); + // DD(mSlicerManagers[selected]->GetFileName()); + emit SelectedImageHasChanged(mSlicerManagers[selected]); } //------------------------------------------------------------------------------ diff --git a/vv/vvMainWindow.h b/vv/vvMainWindow.h index 6426dfd..be50cb7 100644 --- a/vv/vvMainWindow.h +++ b/vv/vvMainWindow.h @@ -54,6 +54,7 @@ class vvMainWindow: public vvMainWindowBase, void ShowLastImage(); virtual void UpdateCurrentSlicer(); + virtual QTabWidget * GetTab(); //vvMainWindowToolInfo * GetInfoForTool(); // void AddRunningTool(vvToolCreatorBase * tool); diff --git a/vv/vvMainWindowBase.h b/vv/vvMainWindowBase.h index 3ec91c5..fffbc28 100644 --- a/vv/vvMainWindowBase.h +++ b/vv/vvMainWindowBase.h @@ -37,6 +37,7 @@ public: virtual void AddImage(vvImage::Pointer image,std::string filename) = 0; virtual void UpdateCurrentSlicer() = 0; + virtual QTabWidget * GetTab() = 0; const std::vector & GetSlicerManagers() const { return mSlicerManagers; } QMenu * GetToolMenu() const { return mMenuTools; } QMenu * GetContextMenu() const { return mContextMenu; } @@ -47,6 +48,7 @@ public: signals: void AnImageIsBeingClosed(vvSlicerManager *); + void SelectedImageHasChanged(vvSlicerManager *); protected: std::vector mSlicerManagers;