Salome HOME
Qt4 porting. Modification, Orientation, Filter. Bad oriented volume criterion. Compar...
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_FilterDlg.cxx
index 8de8a1c3461dc61962d77cbfb2647b7f49417694..1ad06d9d0e88262278db9448f28a4594bd002919 100755 (executable)
@@ -1308,6 +1308,7 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
 
     if (aCompareItem->count() > 0)
       aCompareItem->clear();
+    aTable->setEditable(false, row, 1);
     aTable->setEditable(false, row, 2);
 
     aTable->blockSignals( isSignalsBlocked );
@@ -1322,6 +1323,8 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
     QMap<int, QString> aMap;
     aMap[ SMESH::FT_EqualTo ] = tr("EQUAL_TO");
     aCompareItem->setItems(aMap);
+    if (!aTable->isEditable(row, 2))
+      aTable->setEditable(true, row, 1);
     if (!aTable->isEditable(row, 2))
       aTable->setEditable(true, row, 2);
   }
@@ -1336,6 +1339,8 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
     bool isOk = false;
     aText.toDouble(&isOk);
     aTable->item( row, 2 )->setText(isOk ? aText : QString(""));
+    if (!aTable->isEditable(row, 1))
+      aTable->setEditable(true, row, 1);
     if (!aTable->isEditable(row, 2))
       aTable->setEditable(true, row, 2);
   }
@@ -1691,6 +1696,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();