From: dmv Date: Wed, 8 Oct 2008 11:35:05 +0000 (+0000) Subject: Qt4 porting: the filter is editable, but should not be (MESH-026 GUI test scenario) X-Git-Tag: V5_1_0a3~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=90f96fce551a8330199884e60129dfcc4e4ed065;p=modules%2Fsmesh.git Qt4 porting: the filter is editable, but should not be (MESH-026 GUI test scenario) --- diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 8de8a1c34..d0b2c15dd 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -1691,6 +1691,21 @@ void SMESHGUI_FilterTable::SetEditable (const bool isEditable) { anIter.value()->setReadOnly(!isEditable); + // Set Flags for CheckItems directly IPAL 19974 + Table* aTable = anIter.value(); + for (int i = 0, n = aTable->rowCount(); i < n; i++) + for (int j = 0, m = aTable->columnCount(); j < m; j++) + { + QTableWidgetItem* anItem = aTable->item(i, j); + if ( dynamic_cast( anItem ) ) { + Qt::ItemFlags f = anItem->flags(); + if (!isEditable) f = f & ~Qt::ItemIsUserCheckable; + else f = f | Qt::ItemIsUserCheckable; + anItem->setFlags( f ); + } + } + //end of IPAL19974 + if (isEditable) { myAddBtn->show(); diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index 9a94cb156..90a905dd2 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -854,6 +854,7 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged() myTable->AddCriterion(aCriteria[ i ], myTable->GetType()); myTable->Update(); + updateControlsVisibility(); // IPAL19974 } //=======================================================================