Qt::ItemFlags f = flags();
f = f | Qt::ItemIsUserCheckable;
f = f & ~Qt::ItemIsTristate;
+ f = f & ~Qt::ItemIsEditable;
setFlags( f );
setChecked(value);
}
Qt::ItemFlags f = flags();
f = f | Qt::ItemIsUserCheckable;
f = f & ~Qt::ItemIsTristate;
+ f = f & ~Qt::ItemIsEditable;
setFlags( f );
setChecked( value );
setText( text );
const QModelIndex& index ) const
{
QString value = index.model()->data( index, Qt::DisplayRole ).toString();
- QComboBox* cb = static_cast<QComboBox*>( editor );
+ QComboBox* cb = dynamic_cast<QComboBox*>( editor );
bool bOk = false;
if ( cb ) {
int i = cb->findText( value );
QAbstractItemModel* model,
const QModelIndex& index) const
{
- QComboBox* cb = static_cast<QComboBox*>( editor );
+ QComboBox* cb = dynamic_cast<QComboBox*>( editor );
if ( cb ) model->setData( index, cb->currentText(), Qt::DisplayRole );
else QItemDelegate::setModelData( editor, model, index );
}
{
QTableWidgetItem* anItem = item( row, col );
if ( anItem ) {
+ bool isSignalsBlocked = signalsBlocked();
+ blockSignals( true );
+
Qt::ItemFlags f = anItem->flags();
if ( !isEditable ) f = f & ~Qt::ItemIsEditable;
else f = f | Qt::ItemIsEditable;
anItem->setFlags( f );
+
+ blockSignals( isSignalsBlocked );
}
}
void SMESHGUI_FilterTable::Table::setReadOnly( bool on )
{
setEditTriggers( on ?
+ QAbstractItemView::NoEditTriggers :
QAbstractItemView::DoubleClicked |
QAbstractItemView::SelectedClicked |
QAbstractItemView::EditKeyPressed |
- QAbstractItemView::AnyKeyPressed :
- QAbstractItemView::NoEditTriggers );
+ QAbstractItemView::AnyKeyPressed );
}
bool SMESHGUI_FilterTable::Table::isReadOnly() const
}
} else {
bool aRes = false;
+ bool isSignalsBlocked = aTable->signalsBlocked();
aTable->blockSignals(true);
double aThreshold = (int)aTable->text(i, 2).toDouble(&aRes);
- aTable->blockSignals(false);
+ aTable->blockSignals(isSignalsBlocked);
if (!aRes && aTable->isEditable(i, 2)) {
if (theMess)
aType == SMESH::FACE && aCriterionType == SMESH::FT_FreeEdges ||
aType == SMESH::VOLUME && aCriterionType == SMESH::FT_BadOrientedVolume)
{
+ bool isSignalsBlocked = aTable->signalsBlocked();
+ aTable->blockSignals( true );
+
if (aCompareItem->count() > 0)
aCompareItem->clear();
aTable->setEditable(false, row, 2);
+
+ aTable->blockSignals( isSignalsBlocked );
}
else if (aCriterionType == SMESH::FT_RangeOfIds ||
aCriterionType == SMESH::FT_BelongToGeom ||
}
myIsLocked = false;
+ // IPAL19372 - to prevent calling onCriterionChaged() slot before completion of setItem()
+ bool isSignalsBlocked = theTable->signalsBlocked();
+ theTable->blockSignals( true );
+
// Criteria
theTable->setItem(aCurrRow, 0, getCriterionItem(theType));
theTable->setItem(aCurrRow, 1, getCompareItem());
// Threshold
- //theTable->setItem(aCurrRow, 2, new QTableWidgetItem());
+ theTable->setItem(aCurrRow, 2, new QTableWidgetItem());
- //Logical operation NOT
+ // Logical operation NOT
theTable->setItem(aCurrRow, 3, getUnaryItem());
+ // Logical operation AND / OR
+ theTable->setItem(aCurrRow, 4, new QTableWidgetItem());
+
+ theTable->blockSignals( isSignalsBlocked );
+
// Logical binary operation for previous value
int anAddBinOpStr = -1;
if (aCurrRow == theTable->rowCount() - 1)
}
theTable->setEditable(false, theTable->rowCount() - 1, 4);
-
+
if (aCurrRow >=0 && aCurrRow < theTable->rowCount() &&
aCurrCol >=0 && aCurrCol < theTable->rowCount())
theTable->setCurrentCell(aCurrRow, aCurrCol);