Results 1 to 3 of 3

Thread: Is it wise to use GraphicsView for simple plot ?

  1. #1
    Join Date
    Aug 2009
    Posts
    2
    Qt products
    Qt Jambi
    Platforms
    Windows

    Question Is it wise to use GraphicsView for simple plot ?

    Hi guys,

    I wanna make an application in QtJambi that works with graphs. But unfortunately there's no QWT for QtJambi (as far as I know). So my question is this: Is it wise to use GraphicsView to make a simple graph or will the painting on QWidget suffice ? (If I'm getting this right in GraphicsView I would have to make an QLineF object for every two points I wanna connect, right ?)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Is it wise to use GraphicsView for simple plot ?

    If the plot is very simple, I'd use QWidget with QPainterPath. If it's more complex then QGraphicsView might prove better.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2009
    Posts
    2
    Qt products
    Qt Jambi
    Platforms
    Windows

    Default Re: Is it wise to use GraphicsView for simple plot ?

    Thanks for recomendations.

    I've got another question concerning transformations. That's so freakin' crazy chapter. I could read it again and again and still get very few from it.
    When I draw a graph (suppose it's a constant function for now; in my case the signal is almost constant having very slight oscilations) and I start to scale it using scale() in y direction it start's to slowly come out of view (it's moving upwards). So I would assume scaling is not the same as zooming. And the question is then: How can zoom it in without the graph coming out of view ? (I need to scale it in y direction in order to emphasize the slight oscilation for better view; one could say the unit of lenght on y axis is smaller(after scaling it) then on the x axis)
    It would help to say that before I draw anything I use setWindow(0, -height()/2, width(), height()) to set the origin of logical coordinates to be in the middle of height of the screen (y) and on the left side (it's a time series therefore x is not assumed to be negative; that's why it's on the left)
    If one could explain the difference between the window-viewport and the worldMatrix() transformations I wouldn't mind at all.

    I know it's a lot to answer if you feel like you know something more to any above mentioned please post a reply I would be so greatfull.


    Thanks in advance. (I'll provide additional info if needed, just to get the answers )

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.