From 90f96fce551a8330199884e60129dfcc4e4ed065 Mon Sep 17 00:00:00 2001 From: dmv Date: Wed, 8 Oct 2008 11:35:05 +0000 Subject: [PATCH] Qt4 porting: the filter is editable, but should not be (MESH-026 GUI test scenario) --- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 15 +++++++++++++++ src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx | 1 + 2 files changed, 16 insertions(+) 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 } //======================================================================= -- 2.39.2