Qt4 porting: the filter is editable, but should not be (MESH-026 GUI test scenario)

This commit is contained in:
dmv 2008-10-08 11:35:05 +00:00
parent d5860b4fde
commit 90f96fce55
2 changed files with 16 additions and 0 deletions

View File

@ -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();

View File

@ -854,6 +854,7 @@ void SMESHGUI_FilterLibraryDlg::onFilterChanged()
myTable->AddCriterion(aCriteria[ i ], myTable->GetType());
myTable->Update();
updateControlsVisibility(); // IPAL19974
}
//=======================================================================