Hello ! I'm trying to write a QGraphicsView-based custom widget but some points make me a bit confused.
The aim of my widget is to be able to plot any 2D mathematical function curve. To do this I use a QPainterPath for each curve I want to display. If I well understood the API documentation, this path is built in QGraphicsItem coordinates system. Of course this coordinates system is not well suited to fit in window/widget/view coordinates system. I know the transformation I need to apply to my initial coordinates system to fit in window/widget/view, but my problem is where to apply it. Because beside my curve I also have to display some labels (i.e. some QGraphicsSimpleTextItem). And of course, these labels should not be transformed ! To be more explicit I tried to add some QGraphicsSimpleTextItems to my scene and then I used view.fitInView(scene.sceneRect()), but when I do this my text items are so scaled that they became unreadable. So my question is should I apply my transformation directly to items (this manner doesn't seems very MVC compliant) or is there a way to apply my transformation to a subset of the scene items ? Maybe scene layers can be helpful to do this ? Any help would be really appreciated. jMax PS : Beside this problem I wonder what is the difference between drawBackground() in QGraphicsScene and drawBackground() in QGraphicsView ? _______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
