Results 1 to 4 of 4

Thread: QGraphicsScene load drawing

  1. #1
    Join Date
    Aug 2009
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsScene load drawing

    I started playing with the Diagram Scene example. I saved my drawing intro a svg image, now i want to add a "Load drawing" function.

    please give me some ideas.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QGraphicsScene load drawing

    Quote Originally Posted by emrares View Post
    please give me some ideas.
    You could load simply the picture back in the scene (QGraphicsPixmapItem), but then you can't alter it.
    So you must save all the informations about an item (like position, geometry, color..) in a self defined format to a text file. Then load that file and perform your setting to create the needed items...

  3. #3
    Join Date
    Aug 2009
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsScene load drawing

    10x but i need to save the drawing in a SVG format again because some other program will use this file and needs it in a SVG format.

    so the question remains how do i extract the items from an SVG file and display them on the scene.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QGraphicsScene load drawing

    Ah, ok first I don't read your post right. Sorry. Now I see, svg. So, then you have no other option than interpret the xml code and transform it into graphics items, if you need the items to manipulate the diagrams.

    Or

    you use a svg manipulating library and perform the changes direct on the svg file and then load/refresh a QGraphicsSvgItem which holds the svg image.

Similar Threads

  1. Drawing grids efficiently in QGraphicsScene
    By Gopala Krishna in forum Qt Programming
    Replies: 16
    Last Post: 7th June 2012, 14:59
  2. Replies: 1
    Last Post: 30th April 2009, 07:16
  3. Problems with QString
    By cyberboy in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2008, 08:18
  4. Optimizing polygon clipping in QGraphicsScene drawing
    By maverick_pol in forum Qt Programming
    Replies: 1
    Last Post: 28th September 2008, 20:41
  5. QWidget in QGraphicsScene not drawing
    By stevel in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2008, 19:19

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.