I need to place a QwtPlot in a QScrollArea (I use it to address some magnification/panning issues).
I do this as follow:
sa->setMinimumSize(700, 500);
sa->sizeHint();
sa->setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
sa->setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
plot->setMinimumSize(sa->size());
plot->sizeHint();
sa->setWidget(plot);
QScrollArea *sa = new QScrollArea(this);
sa->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
sa->setMinimumSize(700, 500);
sa->sizeHint();
sa->setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
sa->setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
QwtPlot *plot = new QwtPlot(sa->viewport());
plot->setMinimumSize(sa->size());
plot->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
plot->sizeHint();
sa->setWidget(plot);
To copy to clipboard, switch view to plain text mode
In this way the QwtPlot is only partially visible.
I want to set QwtPlot size to be fully visible inside QScrollArea.
How can I set correctly the QwtPlot size?
thanks
Bookmarks