Results 1 to 4 of 4

Thread: QwtPlot inside QScrollArea

  1. #1
    Join Date
    May 2009
    Posts
    75
    Thanks
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question QwtPlot inside QScrollArea

    I need to place a QwtPlot in a QScrollArea (I use it to address some magnification/panning issues).
    I do this as follow:
    Qt Code:
    1. QScrollArea *sa = new QScrollArea(this);
    2. sa->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    3. sa->setMinimumSize(700, 500);
    4. sa->sizeHint();
    5. sa->setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
    6. sa->setHorizontalScrollBarPolicy ( Qt::ScrollBarAlwaysOn );
    7.  
    8. QwtPlot *plot = new QwtPlot(sa->viewport());
    9. plot->setMinimumSize(sa->size());
    10. plot->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
    11. plot->sizeHint();
    12. 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

  2. #2
    Join Date
    Sep 2009
    Location
    phoenix, AZ
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot inside QScrollArea

    mastupristi,

    l would like to do the same thing than you ... have you solved the issue ??

    regards,

    Michael

  3. #3
    Join Date
    Sep 2009
    Location
    phoenix, AZ
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot inside QScrollArea

    actually l would like to complete my question...

    l would like to add several QWTplot in a QSCrollArea, l would add them from a Palette using Drag and Drop event.

    I can manage the Drag-Drop event to add simple rectangle, but l don't know to add QWTPlot elements.

    any hints ??

    thanks,

    Michael

  4. #4
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot inside QScrollArea

    hi, mastupristi, i am on the same issue as you.
    i think core of the issue is on how to set the proportion of the qwidget size and the qwtplot x-scale.
    I am trying to add qwtplot(chart column) in several QWidget objects in one qstackedwidget container.

    Any progress please let me know.
    Thanks a lot.

Similar Threads

  1. QwtPlot - promote to custom widget
    By MrGarbage in forum Qwt
    Replies: 7
    Last Post: 10th February 2011, 10:12
  2. Force a Scroll in a QScrollArea
    By nmuntz in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2009, 13:49
  3. QScrollArea and resizing
    By rarefluid in forum Qt Programming
    Replies: 8
    Last Post: 22nd July 2007, 14:18
  4. Replies: 2
    Last Post: 8th October 2006, 20:14
  5. QScrollArea problem positioning a QWidget inside
    By Spectator in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 22:59

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.