
Originally Posted by
method
enum QSizePolicy::Policy
This enum describes the various per-dimension sizing types used when constructing a QSizePolicy.
Constant Value Description
QSizePolicy::Fixed 0 The QWidget::sizeHint() is the only acceptable alternative, so the widget can never grow or shrink (e.g. the vertical direction of a push button).
QSizePolicy::Minimum GrowFlag The sizeHint() is minimal, and sufficient. The widget can be expanded, but there is no advantage to it being larger (e.g. the horizontal direction of a push button). It cannot be smaller than the size provided by sizeHint().
QSizePolicy::Maximum ShrinkFlag The sizeHint() is a maximum. The widget can be shrunk any amount without detriment if other widgets need the space (e.g. a separator line). It cannot be larger than the size provided by sizeHint().
QSizePolicy::Preferred GrowFlag | ShrinkFlag The sizeHint() is best, but the widget can be shrunk and still be useful. The widget can be expanded, but there is no advantage to it being larger than sizeHint() (the default QWidget policy).
QSizePolicy::Expanding GrowFlag | ShrinkFlag | ExpandFlag The sizeHint() is a sensible size, but the widget can be shrunk and still be useful. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a horizontal slider).
QSizePolicy::MinimumExpanding GrowFlag | ExpandFlag The sizeHint() is minimal, and sufficient. The widget can make use of extra space, so it should get as much space as possible (e.g. the horizontal direction of a horizontal slider).
QSizePolicy::Ignored ShrinkFlag | GrowFlag | IgnoreFlag The sizeHint() is ignored. The widget will get as much space as possible.
See also PolicyFlag, setHorizontalPolicy(), and setVerticalPolicy().
Hi I changed the previous code so
CentralWidget
::CentralWidget( QWidget* parent
/* = 0 */ ) mp_vBox( 0 ),
m_pWaveU( 0 ),
m_pWaveD( 0 )
{
/* vertical layout */
/* 2 wavwform display */
m_pWaveU = new WaveDisplay( this );
m_pWaveU->setGeometry(10, 10, 200, 150);
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 wavwform display */
m_pWaveU = new WaveDisplay( this );
m_pWaveU->setGeometry(10, 10, 200, 150);
m_pWaveU->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Fixed );
m_pWaveD = new WaveDisplay( this );
m_pWaveD->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
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
But now the m_pWaveU is missing, I can not see it in the form.
Where I'm wrong?
Thank you in advance.
Bookmarks