Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. 2D array into graphicview to create Objects from 2D-Array

2D array into graphicview to create Objects from 2D-Array

Scheduled Pinned Locked Moved Unsolved Game Development
algorithmsarraygraphics view
14 Posts 3 Posters 2.5k 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.
  • P Offline
    P Offline
    projectbavaria
    wrote on 25 May 2020, 15:40 last edited by
    #5

    can't go on i will look From Matrix to QImage and QPixmap on forum.. maybe that will help

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 25 May 2020, 19:12 last edited by
      #6

      Hi,

      Do you mean you have a two dimensional array of chars that you want to build a grid with and that each of the cell of that grid shall contain the letter at that point of the array ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply 26 May 2020, 00:49
      0
      • S SGaist
        25 May 2020, 19:12

        Hi,

        Do you mean you have a two dimensional array of chars that you want to build a grid with and that each of the cell of that grid shall contain the letter at that point of the array ?

        P Offline
        P Offline
        projectbavaria
        wrote on 26 May 2020, 00:49 last edited by
        #7
        This post is deleted!
        P 1 Reply Last reply 26 May 2020, 01:13
        0
        • P projectbavaria
          26 May 2020, 00:49

          This post is deleted!

          P Offline
          P Offline
          projectbavaria
          wrote on 26 May 2020, 01:13 last edited by
          #8
          This post is deleted!
          P 1 Reply Last reply 26 May 2020, 12:37
          0
          • P projectbavaria
            26 May 2020, 01:13

            This post is deleted!

            P Offline
            P Offline
            projectbavaria
            wrote on 26 May 2020, 12:37 last edited by
            #9

            @projectbavaria ![alt text](Unbenannt.jpg image url)

            1 Reply Last reply
            0
            • P Offline
              P Offline
              projectbavaria
              wrote on 26 May 2020, 15:09 last edited by
              #10

              Unbenannt.jpg ![0_1590505663278_14df9cf0-9d3f-4008-97bc-f55769443621-image.png](Uploading 100%)

              now i getting a black screen and try to go on

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 26 May 2020, 18:03 last edited by
                #11

                From what you posted, there's nothing added to the scene and your view seems to be a local variable so unless it's in your main function body, it will be destroyed before you can even see it.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                P 1 Reply Last reply 26 May 2020, 19:05
                0
                • S SGaist
                  26 May 2020, 18:03

                  From what you posted, there's nothing added to the scene and your view seems to be a local variable so unless it's in your main function body, it will be destroyed before you can even see it.

                  P Offline
                  P Offline
                  projectbavaria
                  wrote on 26 May 2020, 19:05 last edited by projectbavaria
                  #12

                  @SGaist but before i destroying it i have to handle that i want to save my array(inside there are my chars) as a QtPiximap -> after that i can show it in GraphisScene ?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 26 May 2020, 21:32 last edited by
                    #13

                    Except that you are not using your array to draw anything. You are using a QBitArray which contains nothing to draw on a image that you then use as brush.

                    You should start by just drawing on that QImage properly and set it on a QLabel to see what it would look like. And once you have that working, come back to your QGraphicsView part.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    P 1 Reply Last reply 26 May 2020, 21:34
                    0
                    • S SGaist
                      26 May 2020, 21:32

                      Except that you are not using your array to draw anything. You are using a QBitArray which contains nothing to draw on a image that you then use as brush.

                      You should start by just drawing on that QImage properly and set it on a QLabel to see what it would look like. And once you have that working, come back to your QGraphicsView part.

                      P Offline
                      P Offline
                      projectbavaria
                      wrote on 26 May 2020, 21:34 last edited by
                      #14

                      @SGaist okey i will try

                      1 Reply Last reply
                      0

                      14/14

                      26 May 2020, 21:34

                      • Login

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