From c85660e58634cfa18ba03f14a8bb3f6ee0cefb93 Mon Sep 17 00:00:00 2001 From: ThePBone Date: Sat, 26 Oct 2019 12:06:33 +0200 Subject: [PATCH] Disabled bandwidth column for unity gain filters --- mainwindow.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mainwindow.h b/mainwindow.h index afe5502..660f122 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -157,30 +157,32 @@ class SaveItemDelegate : public QStyledItemDelegate { return cb; } else if (index.column()==2&&sp) { - //auto p = qobject_cast(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(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; @@ -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); }