I have an application showing QwtPlot widgets inside a QScrollArea.
I have the following code defining my scrollable container:
holder
= new QWidget(ui.
groupBoxChart);
ui.scrollArea->setWidgetResizable(true);
ui.scrollArea->setWidget(holder);
holder = new QWidget(ui.groupBoxChart);
myVerticalLayout = new QVBoxLayout(holder);
ui.scrollArea->setWidgetResizable(true);
ui.scrollArea->setWidget(holder);
To copy to clipboard, switch view to plain text mode
When the user checks a checkbox deciding which plot to display, this code is called:
MyPlot *newPlot = new MyPlot(ui.scrollArea);
myVerticalLayout->addWidget(newPlot);
newPlot->show();
MyPlot *newPlot = new MyPlot(ui.scrollArea);
myVerticalLayout->addWidget(newPlot);
newPlot->show();
To copy to clipboard, switch view to plain text mode
When the user checks a different checkbox, the code hides any displayed plots with hide();
Currently the behavior I get is -
* the first time a plot is shown it is shrinked to fit the size of the scroll area *without* scrollbars displayed.
* after checking a different check box and then checking the first one again (causing hide and then show) the plot is redisplayed larger than the scroll area (thus causing the scrollbars to appear).
I would like to understand what causes this, and then decide how i want it to behave.
Bookmarks