From 354b6309bde6cf75a4c2150a60dc9e7d47fb1ca5 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Thu, 1 Dec 2011 07:57:27 +0000 Subject: [PATCH] fix for Mac issue with mixer fading layout problem --- src/audiomixerboard.cpp | 19 +++++++++++-------- src/audiomixerboard.h | 24 ++++++++---------------- 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 9b78c85b..ad2fc88c 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -31,12 +31,15 @@ CChannelFader::CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout ) { - // create new GUI control objects and store pointers to them - pMainGrid = new QVBoxLayout(); - pFader = new QSlider ( Qt::Vertical, pNW ); - pcbMute = new QCheckBox ( "Mute", pNW ); - pcbSolo = new QCheckBox ( "Solo", pNW ); - pLabel = new QLabel ( "", pNW ); + // create new GUI control objects and store pointers to them (note that + // QWidget takes the ownership of the pMainGrid so that this only has + // to be created locally in this constructor) + pFrame = new QFrame ( pNW ); + QVBoxLayout* pMainGrid = new QVBoxLayout ( pFrame ); + pFader = new QSlider ( Qt::Vertical, pFrame ); + pcbMute = new QCheckBox ( "Mute", pFrame ); + pcbSolo = new QCheckBox ( "Solo", pFrame ); + pLabel = new QLabel ( "", pFrame ); // setup slider pFader->setPageStep ( 1 ); @@ -61,8 +64,8 @@ CChannelFader::CChannelFader ( QWidget* pNW, pMainGrid->addWidget( pcbSolo, 0, Qt::AlignLeft ); pMainGrid->addWidget( pLabel, 0, Qt::AlignHCenter ); - // add fader layout to audio mixer board layout - pParentLayout->addLayout ( pMainGrid ); + // add fader frame to audio mixer board layout + pParentLayout->addWidget( pFrame ); // reset current fader Reset(); diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index f81e9436..04d705e3 100755 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -25,6 +25,7 @@ #if !defined ( MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ ) #define MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ +#include #include #include #include @@ -49,19 +50,10 @@ class CChannelFader : public QObject public: CChannelFader ( QWidget* pNW, QHBoxLayout* pParentLayout ); - ~CChannelFader() - { - pLabel->close(); - pcbMute->close(); - pcbSolo->close(); - pFader->close(); - - // TODO get rid of pMainGrid - } void SetText ( const QString sText ); - void Show() { pLabel->show(); pcbMute->show(); pcbSolo->show(); pFader->show(); } - void Hide() { pLabel->hide(); pcbMute->hide(); pcbSolo->hide(); pFader->hide(); } + void Show() { pFrame->show(); } + void Hide() { pFrame->hide(); } bool IsVisible() { return pLabel->isVisible(); } void SetGUIDesign ( const EGUIDesign eNewDesign ); @@ -74,11 +66,11 @@ protected: double CalcFaderGain ( const int value ); void SetMute ( const bool bState ); - QVBoxLayout* pMainGrid; - QSlider* pFader; - QCheckBox* pcbMute; - QCheckBox* pcbSolo; - QLabel* pLabel; + QFrame* pFrame; + QSlider* pFader; + QCheckBox* pcbMute; + QCheckBox* pcbSolo; + QLabel* pLabel; bool bOtherChannelIsSolo;