Results 1 to 4 of 4

Thread: Plotting graphs in Qt

  1. #1
    Join Date
    Nov 2010
    Posts
    63
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Plotting graphs in Qt

    Hi,
    I want to plot graphs in my program to display the results of a calculation.
    I've been trying regular QGraphicsView functionality, but have been having difficulties getting it to work.
    So far I've been ignoring this 'Qwt' label that has its own forum segment, but from what I'm reading now it seems that Qwt is exactly for that purpose. But I can't find a description in the Qt documentation of what Qwt is and how it works.

    Can someone confirm whether or not I should be using Qwt and tell me where I can find documentation on that ?

    ---
    A second issue that has been puzzling me:
    I've read in the documentation that QGraphicsSimpleTextItem has a 'scale()' function that returns the current scale and a 'setScale(qreal) scale' function that sets one scale factor.
    But when I type 'item->scale' in QtCreator, it also suggests another function, 'scale(qreal sx, qreal sy)', that apparently scales both dimensions invidually, but that I can't find in the documentation.

    So, my questions are:
    - Why is this apparently not in the documentation ?
    - How do these two functions interact ? I've experimented with combining them, but I don't understand the results I get.

    Thank you !
    Hint: Think carefully before picking a user name.

  2. The following user says thank you to Computer Hater for this useful post:

    TheIndependentAquarius (15th January 2014)

  3. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Plotting graphs in Qt

    Qwt is not part of Qt and therefore not documented as part of Qt. It has a sub-forum here because Qwt is quite popular. That forum seems to be routinely read by the author of Qwt.

  4. The following user says thank you to ChrisW67 for this useful post:

    TheIndependentAquarius (15th January 2014)

  5. #3
    Join Date
    Nov 2011
    Posts
    2
    Thanked 1 Time in 1 Post

    Default Re: Plotting graphs in Qt

    For (relatively) simple plots without a hassle, you might be interested in my QCustomPlot widget, see
    http://www.workslikeclockwork.com/in...lotting-widget
    If you're into the Qt documentation (as most of us are, I guess), I might add, that I've done my best to make the documentation of QCustomPlot integrate well (see the documentation section on the site and the online documentation link).

    Regarding your other question:
    The function you see is inherited from QGraphicsItem. If you look at the qgraphicsitem.h header code, you'll see that the Qt developers have noted "// ### obsolete" next to it (along with rotate, shear and translate). I guess because it broke with the getter/setter approach when QTransforms found their way into Qt. If you nevertheless want to scale both dimensions, try making a QTransform (which now has the two-parametric scale method), and applying it to your text item with setTransform.

  6. The following user says thank you to DerManu for this useful post:

    TheIndependentAquarius (15th January 2014)

  7. #4
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Plotting graphs in Qt

    Hi,

    You could check out qt-apps.org. Under the 'widgets' section, you will find several small graphics widgets.

    Regards,
    Marc

  8. The following user says thank you to marcvanriet for this useful post:

    TheIndependentAquarius (15th January 2014)

Similar Threads

  1. Replies: 4
    Last Post: 4th January 2011, 09:47
  2. Qwt print 3 graphs to pdf
    By kiduxituh in forum Qwt
    Replies: 1
    Last Post: 30th August 2010, 19:23
  3. Graphs in Qt
    By qtlinuxnewbie in forum Newbie
    Replies: 4
    Last Post: 20th February 2010, 12:01
  4. Plotting graphs in QGraphicsView using qwt
    By luis_claudio in forum Newbie
    Replies: 0
    Last Post: 14th September 2009, 19:47
  5. Best way to draw x,y graphs
    By steg90 in forum Newbie
    Replies: 1
    Last Post: 14th May 2007, 11:52

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.