Hello,I'm a newer to Qt,These days I have to do a task ,draw graphs with a coordinate. And I use QGraphicsView Frame. First , I create a class named Coordinate which inherit from QGraphicsItem, and another class named draw2Dgraph which is also inherited from QGraphicsItem.Then I use a class name graphView which inherit from QGraphicsView.
Class Coordinate 's main work is to draw axis , ticks, ticks numbers , in a word ,is to draw coordinate system.
Class draw2DGraph is used to draw points or 2D graphs within this coordinate system(Class coordinate), it is a child item of Class Coordinate.
Class graphView is used to set scene and item.
now I want to zoom in ( or zoom out ) the graph and coordinate.So I use the QGraphicsItem::scale() function. And I find that the graph (draw2DGraph object) has been out it's parent boundingrect ,where the coordinate system (Coordinate object )has also been out range it's parent range(QGraphicsScene).
who can tell me how to let the graph only show in the coordinate system range and how to change the coordinate system 's axis and ticks.
How to use this with QGraphicsView Frame .
Wish you to help me !Wish your help ! with some source code to deal with zoom out or zoom in in QGraphicsView Frame!
Thank you very much!