
Originally Posted by
wysota
Great. Try to fit it into those 30 lines. You don't even have to paint anything as you are getting errors before any painting is done - just initialize the painter.
Dear wysota. I solved the problem that gave the error. Is the line:
resize(wave->getSamples(), 200);
resize(wave->getSamples(), 200);
To copy to clipboard, switch view to plain text mode
This did that the waveWidget was expanded ( in the x direction ) more that the mainWindow because the number of audio samples I have is ~10E6.
So I tried to attach the waveWidget to a QScrollArea without success so:
CentralWidget
::CentralWidget( QWidget* parent
/* = 0 */ ) mp_vBox( 0 ),
mp_wave( 0 )
{
/* vertical layout */
/* scroll area */
/* waveform visualizer */
mp_wave = new WaveWidget( this );
scrollArea->setWidget( mp_wave );
mp_vBox->addWidget( scrollArea );
setLayout( mp_vBox );
}
CentralWidget::CentralWidget( QWidget* parent /* = 0 */ )
: QWidget(parent),
mp_vBox( 0 ),
mp_wave( 0 )
{
/* vertical layout */
mp_vBox = new QVBoxLayout( this );
/* scroll area */
scrollArea = new QScrollArea();
/* waveform visualizer */
mp_wave = new WaveWidget( this );
scrollArea->setWidget( mp_wave );
mp_vBox->addWidget( scrollArea );
setLayout( mp_vBox );
}
To copy to clipboard, switch view to plain text mode
This did that now I can't see the waveWidget.
Where my code is wrong?
Best Regards
Bookmarks