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. Save Graphic scene in Database
Forum Update on Monday, May 27th 2025

Save Graphic scene in Database

Scheduled Pinned Locked Moved Solved General and Desktop
graphics scenedatabasesave
12 Posts 2 Posters 4.2k Views
  • 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.
  • mrjjM Offline
    mrjjM Offline
    mrjj
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi
    this show to save load image to db
    https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLite

    for the lines, u need to store x1,y1,x2,y2 and maybe color etc.

    M4RZB4NiM 1 Reply Last reply
    1
    • mrjjM mrjj

      Hi
      this show to save load image to db
      https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLite

      for the lines, u need to store x1,y1,x2,y2 and maybe color etc.

      M4RZB4NiM Offline
      M4RZB4NiM Offline
      M4RZB4Ni
      wrote on last edited by
      #3

      @mrjj
      thanks
      but this save lines has been drawn in scene ?
      or jsut save the pic?

      mrjjM 1 Reply Last reply
      0
      • M4RZB4NiM M4RZB4Ni

        @mrjj
        thanks
        but this save lines has been drawn in scene ?
        or jsut save the pic?

        mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @M4RZB4Ni
        just image unless you change the actual image but
        if you use the normal line object, you must handle that besides the images.
        (as its not part of the image)

        M4RZB4NiM 1 Reply Last reply
        1
        • mrjjM mrjj

          @M4RZB4Ni
          just image unless you change the actual image but
          if you use the normal line object, you must handle that besides the images.
          (as its not part of the image)

          M4RZB4NiM Offline
          M4RZB4NiM Offline
          M4RZB4Ni
          wrote on last edited by
          #5

          @mrjj
          thanks again
          can you help me how i can save that normal lines?

          mrjjM 1 Reply Last reply
          0
          • M4RZB4NiM M4RZB4Ni

            @mrjj
            thanks again
            can you help me how i can save that normal lines?

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by mrjj
            #6

            @M4RZB4Ni
            well , is that not just 4 ints/floats ?
            for start x,y and end x,y ?
            You need to save color or anything else?

            u can use
            http://doc.qt.io/qt-5/qgraphicslineitem.html#line

            to get the points.

            M4RZB4NiM 1 Reply Last reply
            1
            • mrjjM mrjj

              @M4RZB4Ni
              well , is that not just 4 ints/floats ?
              for start x,y and end x,y ?
              You need to save color or anything else?

              u can use
              http://doc.qt.io/qt-5/qgraphicslineitem.html#line

              to get the points.

              M4RZB4NiM Offline
              M4RZB4NiM Offline
              M4RZB4Ni
              wrote on last edited by
              #7

              @mrjj
              i think its better to capture screenshot from that pic and lines
              how can i capture screenshot from x,y location?

              mrjjM 1 Reply Last reply
              0
              • M4RZB4NiM M4RZB4Ni

                @mrjj
                i think its better to capture screenshot from that pic and lines
                how can i capture screenshot from x,y location?

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by mrjj
                #8

                @M4RZB4Ni
                ok, if that is what u wish.
                The lines will no be lines then , when u load it again.
                they will be part of image

                Everything u need for screen capture is here
                http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

                M4RZB4NiM 1 Reply Last reply
                1
                • mrjjM mrjj

                  @M4RZB4Ni
                  ok, if that is what u wish.
                  The lines will no be lines then , when u load it again.
                  they will be part of image

                  Everything u need for screen capture is here
                  http://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

                  M4RZB4NiM Offline
                  M4RZB4NiM Offline
                  M4RZB4Ni
                  wrote on last edited by
                  #9

                  @mrjj
                  thanks
                  i saw this example
                  but this capture all of screen!
                  i want to capture Particular points!
                  How should i do this?

                  mrjjM 1 Reply Last reply
                  0
                  • M4RZB4NiM M4RZB4Ni

                    @mrjj
                    thanks
                    i saw this example
                    but this capture all of screen!
                    i want to capture Particular points!
                    How should i do this?

                    mrjjM Offline
                    mrjjM Offline
                    mrjj
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @M4RZB4Ni
                    hi
                    the core is
                    originalPixmap = screen->grabWindow(0);¨

                    so you can grab any widget or window this way.

                    If you need only a subset of widget, then grab whole widget
                    and cut the pixmap to the wanted size using
                    http://doc.qt.io/qt-4.8/qpixmap.html#copy

                    M4RZB4NiM 2 Replies Last reply
                    1
                    • mrjjM mrjj

                      @M4RZB4Ni
                      hi
                      the core is
                      originalPixmap = screen->grabWindow(0);¨

                      so you can grab any widget or window this way.

                      If you need only a subset of widget, then grab whole widget
                      and cut the pixmap to the wanted size using
                      http://doc.qt.io/qt-4.8/qpixmap.html#copy

                      M4RZB4NiM Offline
                      M4RZB4NiM Offline
                      M4RZB4Ni
                      wrote on last edited by
                      #11
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • mrjjM mrjj

                        @M4RZB4Ni
                        hi
                        the core is
                        originalPixmap = screen->grabWindow(0);¨

                        so you can grab any widget or window this way.

                        If you need only a subset of widget, then grab whole widget
                        and cut the pixmap to the wanted size using
                        http://doc.qt.io/qt-4.8/qpixmap.html#copy

                        M4RZB4NiM Offline
                        M4RZB4NiM Offline
                        M4RZB4Ni
                        wrote on last edited by
                        #12

                        @mrjj
                        Thanks a lot Brother :)
                        My Problem Solved!

                        1 Reply Last reply
                        1

                        • Login

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