I have solved the problem!!!
Here was the code before I fixed it:
privateLayoutWidget
->setGeometry
( QRect( 0,
0,
642,
400 ) );
layout2
= new QVBoxLayout( privateLayoutWidget,
11,
6,
"layout2");
textLabel3
= new QLabel( privateLayoutWidget,
"textLabel3" );
textLabel3
->setMinimumSize
( QSize( 640,
16 ) );
textLabel3
->setAlignment
( int( QLabel::AlignCenter ) );
layout2->addWidget( textLabel3 );
plt = new plotter();
layout2->addWidget( plt);
QWidget* privateLayoutWidget = new QWidget( this, "layout2" );
privateLayoutWidget->setGeometry( QRect( 0, 0, 642, 400 ) );
layout2 = new QVBoxLayout( privateLayoutWidget, 11, 6, "layout2");
textLabel3 = new QLabel( privateLayoutWidget, "textLabel3" );
textLabel3->setMinimumSize( QSize( 640, 16 ) );
textLabel3->setAlignment( int( QLabel::AlignCenter ) );
layout2->addWidget( textLabel3 );
plt = new plotter();
layout2->addWidget( plt);
To copy to clipboard, switch view to plain text mode
I did not set the parent when I created the plotter instance.
I corrected this code to:
privateLayoutWidget
->setGeometry
( QRect( 0,
0,
642,
400 ) );
layout2
= new QVBoxLayout( privateLayoutWidget,
11,
6,
"layout2");
textLabel3
= new QLabel( privateLayoutWidget,
"textLabel3" );
textLabel3
->setMinimumSize
( QSize( 640,
16 ) );
textLabel3
->setAlignment
( int( QLabel::AlignCenter ) );
layout2->addWidget( textLabel3 );
plt = new plotter(privateLayoutWidget);
plt->setMinimumSize(640,200);
layout2->addWidget( plt);
QWidget* privateLayoutWidget = new QWidget( this, "layout2" );
privateLayoutWidget->setGeometry( QRect( 0, 0, 642, 400 ) );
layout2 = new QVBoxLayout( privateLayoutWidget, 11, 6, "layout2");
textLabel3 = new QLabel( privateLayoutWidget, "textLabel3" );
textLabel3->setMinimumSize( QSize( 640, 16 ) );
textLabel3->setAlignment( int( QLabel::AlignCenter ) );
layout2->addWidget( textLabel3 );
plt = new plotter(privateLayoutWidget);
plt->setMinimumSize(640,200);
layout2->addWidget( plt);
To copy to clipboard, switch view to plain text mode
And now it works!
I'm reading some texts to know why is it necessary to specify the parent widget...
Thanks a lot!
Bookmarks