locke
16th March 2010, 10:30
Hi,
I know that there are a lot of threads related to QScrollArea, but I'm can't find the solution to my problem. I want to show a QWt3DPlot (SurfacePlot) inside a Dock. In way that if you zoom the graph, then the scroll bars are shown, and let you move through the graph.
The code is:
SurfacePlot *my3dPlot = new SurfacePlot(this);
QVBoxLayout * m_layoutForWidget = new QVBoxLayout(my3dPlot);
m_layoutForWidget->setAlignment(Qt::AlignTop);
QScrollArea * myscroll3d = new QScrollArea;
myscroll3d->setWidgetResizable(true);
myscroll3d->setWidget(my3dPlot);
//my3dDock was previously defined and initilized
my3dDock->setWidget(myscroll3d);
But It doesn't work, any idea please??
Thanks!
I know that there are a lot of threads related to QScrollArea, but I'm can't find the solution to my problem. I want to show a QWt3DPlot (SurfacePlot) inside a Dock. In way that if you zoom the graph, then the scroll bars are shown, and let you move through the graph.
The code is:
SurfacePlot *my3dPlot = new SurfacePlot(this);
QVBoxLayout * m_layoutForWidget = new QVBoxLayout(my3dPlot);
m_layoutForWidget->setAlignment(Qt::AlignTop);
QScrollArea * myscroll3d = new QScrollArea;
myscroll3d->setWidgetResizable(true);
myscroll3d->setWidget(my3dPlot);
//my3dDock was previously defined and initilized
my3dDock->setWidget(myscroll3d);
But It doesn't work, any idea please??
Thanks!