Skip to content

Commit

Permalink
Disabled bandwidth column for unity gain filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePBone committed Oct 26, 2019
1 parent b8288a0 commit c85660e
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,30 +157,32 @@ class SaveItemDelegate : public QStyledItemDelegate {
return cb;
}
else if (index.column()==2&&sp) {
//auto p = qobject_cast<QTableWidget*>(sp->parent()->parent());
switch (getType(currentType)) {
case biquad::LOW_SHELF:
case biquad::HIGH_SHELF:
sp->setPrefix("S: ");
sp->setEnabled(true);
break;
case biquad::UNITY_GAIN:
sp->setPrefix("");
sp->setEnabled(false);
break;
default:
sp->setPrefix("BW: ");
sp->setEnabled(true);

}
}
else if (index.column()==3&&sp) {
//auto p = qobject_cast<QTableWidget*>(sp->parent()->parent());
switch (getType(currentType)) {
case biquad::PEAKING:
case biquad::LOW_SHELF:
case biquad::UNITY_GAIN:
case biquad::HIGH_SHELF:
sp->setEnabled(true);
//if (p)p->item(index.row(),3)->setFlags(p->item(index.row(),3)->flags() | Qt::ItemIsEditable | Qt::ItemIsEnabled);

break;
default:
sp->setEnabled(false);
//if (p)p->item(index.row(),3)->setFlags(p->item(index.row(),3)->flags() & (~Qt::ItemIsEditable) & (~Qt::ItemIsEnabled));
}
}
return w;
Expand All @@ -202,6 +204,16 @@ class SaveItemDelegate : public QStyledItemDelegate {
return;
}
}
else if (index.column()==2) {
switch (getType(currentType)) {
case biquad::UNITY_GAIN:
//Leave item empty
return;
default:
QStyledItemDelegate::paint(painter,option,index);
return;
}
}
else
QStyledItemDelegate::paint(painter,option,index);
}
Expand Down

0 comments on commit c85660e

Please sign in to comment.