bool SMESHGUI_FilterTable::Table::isReadOnly() const
{
- return editTriggers() != QAbstractItemView::NoEditTriggers;
+ return editTriggers() == QAbstractItemView::NoEditTriggers;
}
//=======================================================================
// layout widgets
QGridLayout* aLay = new QGridLayout(myTableGrp);
- aLay->setMargin(0);
+ aLay->setMargin(MARGIN);
aLay->setSpacing(SPACING);
aLay->addWidget(mySwitchTableGrp, 0, 0, 7, 1);
connect(myFileName, SIGNAL(returnPressed()), this, SLOT(onReturnPressed()));
connect(myOpenBtn, SIGNAL(clicked()), this, SLOT(onBrowse()));
- connect(myListBox, SIGNAL( currentItemChanged( QListWidgetItem*, QListWidgetItem* ) ),
- this, SLOT( onFilterChanged( QListWidgetItem*, QListWidgetItem* ) ) );
+ connect(myListBox, SIGNAL(itemSelectionChanged()),
+ this, SLOT(onFilterChanged()));
connect(myAddBtn, SIGNAL(clicked()), this, SLOT(onAddBtnPressed()));
connect(myDeleteBtn, SIGNAL(clicked()), this, SLOT(onDeleteBtnPressed()));
//=======================================================================
// name : SMESHGUI_FilterLibraryDlg::onFilterChanged
-// Purpose : SLOT. Called when selected filter of library changed
+// Purpose : SLOT. Called when selected filter of library is changed
//=======================================================================
-void SMESHGUI_FilterLibraryDlg::onFilterChanged( QListWidgetItem* item, QListWidgetItem* )
+void SMESHGUI_FilterLibraryDlg::onFilterChanged()
{
- QString theName = item ? item->text() : QString::null;
+ QString theName = myListBox->currentItem() ? myListBox->currentItem()->text() : QString::null;
if (myLibrary->_is_nil())
return;
{
if (!isValid(true))
return;
- }
- {
+
SMESH::Filter_var aFilter = createFilter();
myLibrary->Replace(myCurrFilterName.toLatin1().constData(),
myName->text().toLatin1().constData(),
aFilter);
}
+ myTable->Clear(myTable->GetType());
addFilterToLib(getDefaultFilterName());
}