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. QTableView in QGraphicsScene too slow

QTableView in QGraphicsScene too slow

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

    Hello,

    I put an QTableView with the help of a QGraphicsProxyWidget into my QGraphicsScene...
    The TableView is rendered extremely slow. For my QGraphicsView i use an OpenGL Render Context. The Model is a SQLTableModel. The screen renders at about 2 frames per second, which is too slow for my realtime application! Any tips?

    Greetings
    Matthias

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      [quote author="zweistein" date="1346855989"]Hello,
      Any tips?[/quote]
      Yeah: don't use QGraphicsProxyWidget. Putting widgets inside a QGraphicsView is basically a failed experiment. It only soft-of works, and as you noticed, has performance issues.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zweistein
        wrote on last edited by
        #3

        Ok, but what is an easy way to use the normal TableView, when my Application is a Fullscreen QGraphicsview? So i have to put the QTableView inside of that QGraphicsview.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          There is no easy way for that. Not really.

          What you could investigate, is using QML to render a table view on your QGraphicsView. I think it is possible to mix QML and normal QGraphicsItems in the same view, as long as you use Quick 1. I don't know of the Components (that has a table view for QML) works with Quick 1 though. Note that I have not tried any of this myself.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pkj__
            wrote on last edited by
            #5

            No, in my opinion, I will not call QGraphicsProxyWidget a failed experiment. I have had a fairly complex TableView and TreeView implemented via GraphicsView framework. And it worked alright. But they were not using SQL tables. And no GL context either. It didn't have delegates either. But they were as great as the widget itself.
            Have you tried working with it as just a widget. May be, the widget itself is taking time to process data from tables?

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              zweistein
              wrote on last edited by
              #6

              Hello,

              i did the following which was very easy. But i dont know if that is a good solution:

              I gave my QApplication to the constructor of QTableView. This way, my QTableView is a child of my MainWindow. Then i said:

              @m_TableView.setWindowFlags(Qt::Tool | Qt::FramelessWindowHint );
              m_TableView.show( );@

              This works very good so far! The Window is not moveable and on top of my GraphicsView. It doesnt even show up in my Taskbar... My GraphicsView is the centralWidget of my QApplication.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                pkj__
                wrote on last edited by
                #7

                Use this document to further increase efficiency.
                "Cost of convenience":http://swik.net/Trolltech/Trolltech+Labs+Blogs/Qt+Graphics+and+Performance+-+The+Cost+of+Convenience/djej7

                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