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. Saving the current state of a QGraphicsScene.
Qt 6.11 is out! See what's new in the release blog

Saving the current state of a QGraphicsScene.

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.6k Views 1 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.
  • musimbateM Offline
    musimbateM Offline
    musimbate
    wrote on last edited by
    #1

    Hi ,
    I need to implement a saving feature in my application .Let say that a user opens the application,draws to rectangles on the scene and quits.The new feature would allow him to save the current state of the scene so that it can loaded when the application is run again.

    Is there a way this can be easily achieved in Qt?
    Thanks.

    Why join the navy if you can be a pirate?-Steve Jobs

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on last edited by
      #2

      Hi!
      At first, get all items:
      @QList<QGraphicsItem *> QGraphicsScene::items ()@
      then, you can save parameters of items as you wish.
      Usually i use QDomDocument.

      1 Reply Last reply
      0
      • musimbateM Offline
        musimbateM Offline
        musimbate
        wrote on last edited by
        #3

        Thanks qxoz,you really saved me some time!
        QDomDocument ,here I come!

        Why join the navy if you can be a pirate?-Steve Jobs

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          qxoz
          wrote on last edited by
          #4

          You're welcome.
          I am glad to be helpful :) .

          1 Reply Last reply
          0

          • Login

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