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. SOLVED :is there such a thing as QGraphicsTableItem you can add to a QGraphicsScene?
Forum Updated to NodeBB v4.3 + New Features

SOLVED :is there such a thing as QGraphicsTableItem you can add to a QGraphicsScene?

Scheduled Pinned Locked Moved General and Desktop
10 Posts 3 Posters 3.5k 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 an editable table in my application(based on the QGraphicsScene/QGraphicsView Framework) and I was looking in the doc for something to start off with but haven''t found anything attractive so far.I was wondering if anybody knew if there is something I can inherit from or any other piece of work I can use to get the job done.

    Thanks for your input.

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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Is adding a QTableWidget to your scene a possible solution ?

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

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

        Thanks for the reply SGaist,
        QTableWidget has all the things I need but I have trouble transforming it to a QGraphicsItem so I can add it to the scene.I there a way I can do this?
        Thanks again for the input.

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

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          QGraphicsProxyWidget ;)
          You may also want to check the "examples":http://qt-project.org/doc/qt-5/qtwidgets-graphicsview-embeddeddialogs-example.html

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

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

            Thanks guys ,this looks like what I need .

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

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

              Hi again,
              I tried your suggestion guys and the Widget can be added to my scene.But i still have one problem.My new widget in the scene can't take advantage of the features of the scene such us the being moved in the scene when the isMovable floag is applied.I added the widget as follows
              @
              //mProxy is a QGraphicsProxyWidget pointer defined
              //in my header.
              mProxy=testScene->addWidget(tableContainerWidget);
              mProxy->translate(300,0);
              mProxy->setFlag(QGraphicsItem::ItemIsMovable);

              @

              Any help will be appreciated.
              Thanks.

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

              1 Reply Last reply
              0
              • raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                when your widget consumes the mouse event you wont be able to move the item in the scene. You will need to add something like a frame to move it. Like you would do for frameless top-level windows.

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

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

                  Thanks for the quick reply,
                  [quote author="raven-worx" date="1377498099"]. You will need to add something like a frame to move it. Like you would do for frameless top-level windows.[/quote]

                  I apologize if this is obvious but how exactly can I add a frame to a widget ,and how does the frame help in moving the widget in the scene.
                  Thanks again.

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

                  1 Reply Last reply
                  0
                  • raven-worxR Offline
                    raven-worxR Offline
                    raven-worx
                    Moderators
                    wrote on last edited by
                    #9

                    You should rather create a frame by adding a QGraphicsItem to your scene with your QGraphicsProxyWidget as a child-item.

                    --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                    If you have a question please use the forum so others can benefit from the solution in the future

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

                      Thanks,I can now move them in my scene.

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

                      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