Results 1 to 16 of 16

Thread: QT GraphicsView Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    32
    Thanks
    3

    Default Re: QT GraphicsView Help

    Quote Originally Posted by maxpower View Post
    Qt will automatically add a scrollbar if the QGraphicsScene/View is too big for the current window. In your example, you would either want to move your horizontal labels inside the scene so that they get scrolled too, or you would have to subclass the scrollbar so that when it moved your label would change.

    mAx
    the above example is a QWT plot. when you say that Qt will automatically add a scrollbar in the GraphicsScene/View is too big, did you mean that this was also true for QWT. because the QWT plot appears to stay in a fixed restraints without a scrollbar.

  2. #2
    Join Date
    Oct 2006
    Posts
    60
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11

    Default Re: QT GraphicsView Help

    I am talking about QGraphicsScene/View. I have no idea about qwt.

    mAx

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

    Default Re: QT GraphicsView Help

    Have a look at the realtime example, that is included in the Qwt package. It shows how to add scrollbars to a plot. ( they appear, when you zoom in. ). Guess you can copy and use the ScrollZoomer class, like it is.

    Instead of scrollbars you could also use wheels, what is demonstated in the eventfilter example. Another option for navigation is panning (QwtPlotPanner). The bode example shows how to combine zooming and panning.

    HTH,
    Uwe

  4. #4
    Join Date
    Feb 2007
    Posts
    32
    Thanks
    3

    Default Re: QT GraphicsView Help

    has anyone done plotting with QPolygonF or QPainterPath? i am having trouble understanding the coordinate system. for instance, if i use the following function:

    void QPainterPath::lineTo ( qreal x, qreal y )

    lineTo(1,4); how does this actually work? because it seems to be upside or something?

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT GraphicsView Help

    did u use moveTo() before lineTo() ??

  6. #6
    Join Date
    Feb 2007
    Posts
    32
    Thanks
    3

    Default Re: QT GraphicsView Help

    Quote Originally Posted by aamer4yu View Post
    did u use moveTo() before lineTo() ??
    yes i did. does the QGraphicsScene rely on the cartesian coordinate system? because something is really messed up.

  7. #7
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT GraphicsView Help

    may be you are confusing the cordinate systems...
    cartesian systems start from bottom left.... while painting in devices has a cordinate system starting from top left

    i guess u r getting the result upside down on Y axis ??

Similar Threads

  1. GraphicsView rotate problem
    By forrestfsu in forum Qt Programming
    Replies: 7
    Last Post: 21st November 2007, 20:20

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
  •  
Qt is a trademark of The Qt Company.