--- qsampler/trunk/src/qsamplerChannelFxForm.cpp 2008/02/19 22:15:18 1706 +++ qsampler/trunk/src/qsamplerChannelFxForm.cpp 2020/03/27 17:57:40 3758 @@ -1,6 +1,7 @@ // qsamplerChannelFxForm.cpp // /**************************************************************************** + Copyright (C) 2010-2020, rncbc aka Rui Nuno Capela. All rights reserved. Copyright (C) 2008, Christian Schoenebeck This program is free software; you can redistribute it and/or @@ -13,9 +14,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ @@ -104,22 +105,19 @@ namespace QSampler { -ChannelFxForm::ChannelFxForm ( - Channel* pSamplerChannel, QWidget* pParent, Qt::WindowFlags wflags ) - : QDialog(pParent, wflags) +ChannelFxForm::ChannelFxForm ( Channel *pSamplerChannel, QWidget *pParent ) + : QDialog(pParent) { m_ui.setupUi(this); m_pSamplerChannel = pSamplerChannel; - m_pAudioDevice = NULL; + m_pAudioDevice = nullptr; FxSendsModel* pModel = new FxSendsModel(m_pSamplerChannel->channelID(), m_ui.SendsListView); m_ui.SendsListView->setModel(pModel); -#ifdef QT_VERSION >= 0x040300 m_ui.SendsListView->setSelectionRectVisible(true); -#endif const int iRowHeight = m_ui.audioRoutingTable->fontMetrics().height() + 4; m_ui.audioRoutingTable->verticalHeader()->setDefaultSectionSize(iRowHeight); @@ -130,21 +128,25 @@ ChannelRoutingDelegate* pRoutingDelegate = new ChannelRoutingDelegate(m_ui.audioRoutingTable); m_ui.audioRoutingTable->setItemDelegate(pRoutingDelegate); +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + m_ui.audioRoutingTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch); +#else m_ui.audioRoutingTable->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch); +#endif // m_ui.audioRoutingTable->verticalHeader()->hide(); QAbstractButton* pApplyButton = m_ui.buttonBox->button(QDialogButtonBox::Apply); pApplyButton->setEnabled(false); - pApplyButton->setIcon(QIcon(":/icons/formEdit.png")); + pApplyButton->setIcon(QIcon(":/images/formEdit.png")); QAbstractButton* pCancelButton = m_ui.buttonBox->button(QDialogButtonBox::Cancel); - pCancelButton->setIcon(QIcon(":/icons/formRemove.png")); + pCancelButton->setIcon(QIcon(":/images/formRemove.png")); QAbstractButton* pOkButton = m_ui.buttonBox->button(QDialogButtonBox::Ok); - pOkButton->setIcon(QIcon(":/icons/formAccept.png")); + pOkButton->setIcon(QIcon(":/images/formAccept.png")); QAbstractButton* pResetButton = m_ui.buttonBox->button(QDialogButtonBox::Reset); @@ -243,11 +245,11 @@ // clear routing model ChannelRoutingModel* pRoutingModel = (ChannelRoutingModel*) m_ui.audioRoutingTable->model(); - pRoutingModel->refresh(NULL, ChannelRoutingMap()); + pRoutingModel->refresh(nullptr, ChannelRoutingMap()); pRoutingModel->routingMap().clear(); // Reset routing change map. if (m_pAudioDevice) { delete m_pAudioDevice; - m_pAudioDevice = NULL; + m_pAudioDevice = nullptr; } if (!pFxSend) return;