Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QGraphicsScene save to file, and read the file to reload ?
Forum Updated to NodeBB v4.3 + New Features

QGraphicsScene save to file, and read the file to reload ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 2.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • sonichyS Offline
    sonichyS Offline
    sonichy
    wrote on last edited by
    #1

    QGraphicsScene is very convenient to edit QGraphicsItem.
    Is there a good way to save QGraphicsitems to file to make it reloadable to edit again like photoshop ?

    https://github.com/sonichy

    Pl45m4P 1 Reply Last reply
    0
    • sonichyS sonichy

      QGraphicsScene is very convenient to edit QGraphicsItem.
      Is there a good way to save QGraphicsitems to file to make it reloadable to edit again like photoshop ?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @sonichy

      Try this. But instead of grabbing the whole QGraphicsScene, I think it will work on QGraphicItems as well.
      (Convert the QGraphicsItem to QPixmap like here, then write Pixmap to *.png, *.jpg file)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        @Pl45m4 solution will allow you to make bitmap images of the scene/items and edit on other programs.

        However, if you mean to save the scene as a file and later load the same scene, you will need to save it differently for that to be possible.

        see here for a sample saving the items.
        https://stackoverflow.com/questions/30678877/save-load-items-from-a-qgraphicsscene

        1 Reply Last reply
        3

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved