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 );
}
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)
}
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)