Hello,
I hope this is the right Forum for this, perhaps it's more a general QT-Question, but my main problem is that I have to add a ScrollBar to a QwtCurvePlot and I fail to do so.
My code in short looks like this:
widget.cpp
ui(new Ui::Widget)
{
ui->setupUi(this);
this.setupPlot();
}
setupPlot() {
// sa->setWidget(this); // he compiles this line, but shows no window...
curve->attach(this);
}
Widget::Widget(QWidget *parent) : QwtPlot(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
this.setupPlot();
}
setupPlot() {
QwtPlotCurve *curve new QwtPlotCurve();
QScrollArea *sa = new QScrollArea;
// sa->setWidget(this); // he compiles this line, but shows no window...
curve->attach(this);
}
To copy to clipboard, switch view to plain text mode
So my question is: How do I "link" the QScrollArea with my widget/curve, so that I can Scroll the QwtPlotCurve? I tried everything I could imagine but I'm running out of ideas. As a QT-Noobie, I guessed I have the widget (this) where my curve is attached to, but when I attach the QScrollArea to "this", he shows no Window after building the code. If I run:
QScrollArea *sa = new QScrollArea(this);
instead of:
sa->setWidget(this).
I get a grey Box in the top left corner, I guess this is the ScrollArea I wanted, but how can i attach the curve to that Area?
Thanks in advance,
Fanwa
Bookmarks