Results 1 to 2 of 2

Thread: QwtPlotCurve and QScrollArea

  1. #1
    Join Date
    Dec 2010
    Posts
    1

    Default QwtPlotCurve and QScrollArea

    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
    Qt Code:
    1. Widget::Widget(QWidget *parent) : QwtPlot(parent),
    2. ui(new Ui::Widget)
    3. {
    4. ui->setupUi(this);
    5. this.setupPlot();
    6. }
    7.  
    8. setupPlot() {
    9.  
    10. // sa->setWidget(this); // he compiles this line, but shows no window...
    11.  
    12. curve->attach(this);
    13.  
    14. }
    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

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,311
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotCurve and QScrollArea

    No answer to your question, but: check the Qwt realtime example. It implemets a zoomer, that adds scrollbars when you zoom in.

    Uwe

Similar Threads

  1. Replies: 1
    Last Post: 6th May 2010, 07:25
  2. Different symbol on a QwtPlotCurve
    By jomarin in forum Qwt
    Replies: 3
    Last Post: 24th March 2010, 10:27
  3. QwtPlotCurve Selection
    By WXNSNW in forum Qwt
    Replies: 1
    Last Post: 5th August 2009, 07:41
  4. Replies: 2
    Last Post: 10th March 2008, 20:16
  5. How to get a custom QwtPlotCurve?
    By luffy27 in forum Qwt
    Replies: 1
    Last Post: 6th June 2007, 23:11

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.