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. Example Using QGraphicsView Class

Example Using QGraphicsView Class

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 455 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.
  • L Offline
    L Offline
    leinad
    wrote on last edited by
    #1

    Hi,

    I'm trying to build a dynamic a * a matrix where in each cell I'd like to have a icon like a red dot. When the user clicks on the dot within a cell a popup window will come up providing certain information. The matrix essentially shows nodes of machines. When clicking on a cell, I get ping results which coincide with the machine that sends the ping and the one that gets it. So the rows shows machines which got pinged and the columns show machines that sent the ping. Are there any examples to show how to build a matrix table using QGraphicsView? I can work on the details myself but I'm not sure where to start. If someone can give me a starting point here, that would be great!

    Thanks.

    Pl45m4P 1 Reply Last reply
    0
    • L leinad

      Hi,

      I'm trying to build a dynamic a * a matrix where in each cell I'd like to have a icon like a red dot. When the user clicks on the dot within a cell a popup window will come up providing certain information. The matrix essentially shows nodes of machines. When clicking on a cell, I get ping results which coincide with the machine that sends the ping and the one that gets it. So the rows shows machines which got pinged and the columns show machines that sent the ping. Are there any examples to show how to build a matrix table using QGraphicsView? I can work on the details myself but I'm not sure where to start. If someone can give me a starting point here, that would be great!

      Thanks.

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

      @leinad said in Example Using QGraphicsView Class:

      Are there any examples to show how to build a matrix table using QGraphicsView?

      Why do you want to draw your matrix as QGraphicsItem?
      What prevents you from using just a QTableView / QTableWidget with some custom item delegates in your rows or columns?


      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
      2
      • L Offline
        L Offline
        leinad
        wrote on last edited by
        #3

        I thought of that, but the managers want me to use QGraphicsItem. It was originally done in Java where they drew the matrix so they want a similar design.

        JoeCFDJ mrjjM 2 Replies Last reply
        0
        • L leinad

          I thought of that, but the managers want me to use QGraphicsItem. It was originally done in Java where they drew the matrix so they want a similar design.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #4

          @leinad it looks like your managers may not know much about Qt. It can be done in both qt widgets and QGraphicsView.
          You can use QGraphicsSvgItem for cells.

          1 Reply Last reply
          1
          • L leinad

            I thought of that, but the managers want me to use QGraphicsItem. It was originally done in Java where they drew the matrix so they want a similar design.

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

            @leinad

            hi
            But do you need scrolling of the rows ?
            While you can custom paint anything you like, its
            harder to get scrolling working if its all painted.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              leinad
              wrote on last edited by
              #6

              I can have hundreds of cells since each cell represents a ping between machines and can have hundreds of machines, so probably will need scroll bars if the matrix is larger than the view.

              JoeCFDJ 1 Reply Last reply
              0
              • L leinad

                I can have hundreds of cells since each cell represents a ping between machines and can have hundreds of machines, so probably will need scroll bars if the matrix is larger than the view.

                JoeCFDJ Offline
                JoeCFDJ Offline
                JoeCFD
                wrote on last edited by
                #7

                @leinad https://doc.qt.io/qt-5/qtwidgets-graphicsview-chip-example.html

                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