Results 1 to 3 of 3

Thread: QGraphicsView transformations and resizing

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Posts
    30
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1

    Default QGraphicsView transformations and resizing

    Hi all,

    I'm very aware of the existence of Qwt and such, but I am (educationally and more) trying to create my own plotting code in Qt (for now it's an app, easy to debug, later it would be a library much like QtGui and such... that's the idea ).

    Currently I'm struggling with QTransform and setSceneRect and resizing stuff...
    1) I would like my plot to resize and fit in the window/widget. Currently I have set the sceneRect to a square between 0 and 100 and drawn a grid on it that shows the borders and the 20-40-60-80 lines. When you resize this , the grid assumes the widget's smallest dimension, which is quite logical seeing the resize function I implemented. I would, however, like the grid to fill the whole QGraphicsView/Scene (which is it?) and "stretch" the spacing of the lines accordingly.
    2) After step one is complete: I know there is a setCosmetic that keeps width and all constant. Is this usable for my axes and axes labels and legend, so that their position is scaled, but their shape is not?

    Thanks a bunch, I've been struggling with this a lot!
    PS: I've attached the source code and 64-bit windows debug binary. As of this moment I get a link.exe crash so it could be there's a small typo-ish bug in the code at the moment. Sorry for that.
    Attached Files Attached Files

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