Hi,
I trying to layout my widgets but it doesn't work.
I would create 2 widget with a fixed hight and an expanding width but it doesn't work.
I create them so:
CentralWidget
::CentralWidget( QWidget* parent
/* = 0 */ ) mp_vBox( 0 ),
m_pWaveU( 0 ),
m_pWaveD( 0 )
{
/* vertical LAYOUT */
/* 2 WAVEFORM DISPLAY */
m_pWaveU = new WaveDisplay( this );
m_pWaveU->setGeometry(0, 0,200,150); // I would for this a fixed geometry in height
m_pWaveU
->setSizePolicy
( QSizePolicy::Ignored,
QSizePolicy::Minimum );
//I WOULD THIS WITH A FIXED HEIGHT AND THAT IT CAN EXPAND HORIZONTALY
m_pWaveD = new WaveDisplay( this );
mp_vBox->addWidget( m_pWaveU );
mp_vBox->addSpacing( 15 );
mp_vBox->addWidget( m_pWaveD );
setLayout(mp_vBox);
}
CentralWidget::CentralWidget( QWidget* parent /* = 0 */ )
: QWidget(parent),
mp_vBox( 0 ),
m_pWaveU( 0 ),
m_pWaveD( 0 )
{
/* vertical LAYOUT */
mp_vBox = new QVBoxLayout( this );
/* 2 WAVEFORM DISPLAY */
m_pWaveU = new WaveDisplay( this );
m_pWaveU->setGeometry(0, 0,200,150); // I would for this a fixed geometry in height
m_pWaveU->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Minimum );//I WOULD THIS WITH A FIXED HEIGHT AND THAT IT CAN EXPAND HORIZONTALY
m_pWaveD = new WaveDisplay( this );
m_pWaveD->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored );
mp_vBox->addWidget( m_pWaveU );
mp_vBox->addSpacing( 15 );
mp_vBox->addWidget( m_pWaveD );
setLayout(mp_vBox);
}
To copy to clipboard, switch view to plain text mode
Where my code is wrong?
Best Regards
Bookmarks