Salome HOME
Qt4 porting: the filter is editable, but should not be (MESH-026 GUI test scenario)
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_FilterDlg.cxx
index 8de8a1c3461dc61962d77cbfb2647b7f49417694..d0b2c15dd80166144b4b61b6932081536e3c568f 100755 (executable)
@@ -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<SMESHGUI_FilterTable::CheckItem*>( 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();