From: dsarrut Date: Thu, 27 May 2010 09:31:04 +0000 (+0000) Subject: hide inputselector option X-Git-Tag: v1.2.0~632 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=f7b421ee98a5fcec0f7072c339792c5534b1504c;p=clitk.git hide inputselector option --- diff --git a/vv/vvToolWidgetBase.cxx b/vv/vvToolWidgetBase.cxx index d19e1d5..210027d 100644 --- a/vv/vvToolWidgetBase.cxx +++ b/vv/vvToolWidgetBase.cxx @@ -54,35 +54,57 @@ vvToolWidgetBase::vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f) //------------------------------------------------------------------------------ -vvToolWidgetBase::~vvToolWidgetBase() +vvToolWidgetBase::vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f, bool b): + QDialog(NULL, f), + Ui::vvToolWidgetBase() { + DD("const without qdialog"); + // TRIAL + + mIsInitialized = false; + mFilter = 0; + mMainWindow = parent; + // setModal(false); + //setAttribute(Qt::WA_DeleteOnClose); + mCurrentSlicerManager = 0; + + // GUI Initialization + setupUi(this); + + // Connect signals & slots + connect(mMainWindow, SIGNAL(AnImageIsBeingClosed(vvSlicerManager*)), + this, SLOT(AnImageIsBeingClosed(vvSlicerManager*))); + connect(mToolInputSelectionWidget, SIGNAL(accepted()), this, SLOT(InputIsSelected())); + connect(mToolInputSelectionWidget, SIGNAL(rejected()), this, SLOT(close())); + //connect(buttonBox, SIGNAL(accepted()), this, SLOT(apply())); + //connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); + // Disable main widget while input image is not selected + mToolWidget->setEnabled(false); + buttonBox->hide(); + hide(); + DD("end const"); } //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -// void vvToolWidgetBase::SetNumberOfNeededInputs(int nb) { -// mNumberOfInputs = nb; -// mListOfFilters.resize(nb); -// for(int i=0; iGetSlicerManagers().size()); int j=0; mFilter = f; mSlicerManagersCompatible.clear(); mToolInputSelectionWidget->setToolTip(QString("%1").arg(mFilter->GetAvailableImageTypes().c_str())); for(unsigned int i=0; iGetSlicerManagers().size(); i++) { - // DD(i); vvImage * s = mMainWindow->GetSlicerManagers()[i]->GetImage(); - // DD(s->GetScalarTypeAsString()); if (mFilter->CheckImageType(s->GetNumberOfDimensions(), s->GetNumberOfScalarComponents(), s->GetScalarTypeAsString())) { @@ -104,8 +126,6 @@ void vvToolWidgetBase::AddInputSelector(QString s, clitk::ImageToImageGenericFil //------------------------------------------------------------------------------ void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip) { - // DD("AddInput without filter"); - // DD(mMainWindow->GetSlicerManagers().size()); mSlicerManagersCompatible.clear(); for(unsigned int i=0; iGetSlicerManagers().size(); i++) { mSlicerManagersCompatible.push_back(mMainWindow->GetSlicerManagers()[i]); @@ -121,11 +141,21 @@ void vvToolWidgetBase::AddInputSelector(QString s, bool allowSkip) //------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ +void vvToolWidgetBase::HideInputSelector() +{ + QList s; + s.push_back(0); + s.push_back(1); + splitter->setSizes(s); +} +//------------------------------------------------------------------------------ + + //------------------------------------------------------------------------------ void vvToolWidgetBase::show() { if (!mIsInitialized) { - // DD("show -> init"); mToolInputSelectionWidget->Initialize(); mIsInitialized = true; } @@ -137,7 +167,6 @@ void vvToolWidgetBase::show() //------------------------------------------------------------------------------ bool vvToolWidgetBase::close() { - // DD("vvToolWidgetBase::close()"); return QDialog::close(); } //------------------------------------------------------------------------------ diff --git a/vv/vvToolWidgetBase.h b/vv/vvToolWidgetBase.h index a157f38..a291366 100644 --- a/vv/vvToolWidgetBase.h +++ b/vv/vvToolWidgetBase.h @@ -34,12 +34,14 @@ class vvToolWidgetBase: public: vvToolWidgetBase(vvMainWindowBase * parent=0, Qt::WindowFlags f=0); + vvToolWidgetBase(vvMainWindowBase * parent, Qt::WindowFlags f, bool b); ~vvToolWidgetBase(); virtual void InputIsSelected(vvSlicerManager *m); virtual void InputIsSelected(std::vector & l); void AddInputSelector(QString s, clitk::ImageToImageGenericFilterBase * f, bool allowSkip=false); void AddInputSelector(QString s, bool allowSkip=false); + void HideInputSelector(); public slots: virtual void apply() = 0;