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. When to use QGraphicsWidget/Item over QWidget?
QtWS25 Last Chance

When to use QGraphicsWidget/Item over QWidget?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.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
    patrickkidd
    wrote on last edited by
    #1

    Hello! I am building a relatively simple diagraming tool and the docs don't really make it clear when to choose QGraphics* over QWidget and basic painting. The diagrams aren't going to get terribly complex (see attached photo) so I am not concerned about performance for sheer number of items. However, I do want to be able to pinch and zoom very smoothly as well as implement a very nice drawing response with the Apple pencil.

    So should I choose QGraphics* or QWidget?

    Probably own't exceed this level of complexity:
    Family Diagram

    Thanks!

    https://alaskafamilysystems.com/

    1 Reply Last reply
    0
    • P Offline
      P Offline
      patrickkidd
      wrote on last edited by
      #3

      I stumbled across the section in the documentation called Graphics View Architecture. While it doesn't answer my question directly, it does give me enough information to make a decision considering I am already quite familiar with QWidget painting.

      The graphics view appears to be the best choice in my case because it offers all the mouse events, antialiasing and double-precision rendering, collision detection, etc.

      I guess the problems was that I couldn't find it from the start page.

      https://alaskafamilysystems.com/

      mrjjM 1 Reply Last reply
      0
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #2

        Suggest to use qgraphics as qgraphics items are not heavy

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        3
        • P Offline
          P Offline
          patrickkidd
          wrote on last edited by
          #3

          I stumbled across the section in the documentation called Graphics View Architecture. While it doesn't answer my question directly, it does give me enough information to make a decision considering I am already quite familiar with QWidget painting.

          The graphics view appears to be the best choice in my case because it offers all the mouse events, antialiasing and double-precision rendering, collision detection, etc.

          I guess the problems was that I couldn't find it from the start page.

          https://alaskafamilysystems.com/

          mrjjM 1 Reply Last reply
          0
          • dheerendraD Offline
            dheerendraD Offline
            dheerendra
            Qt Champions 2022
            wrote on last edited by
            #4

            Cool. You have made the right choice. Enjoy the painting now. You can move the issue to solved also.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply
            5
            • P patrickkidd

              I stumbled across the section in the documentation called Graphics View Architecture. While it doesn't answer my question directly, it does give me enough information to make a decision considering I am already quite familiar with QWidget painting.

              The graphics view appears to be the best choice in my case because it offers all the mouse events, antialiasing and double-precision rendering, collision detection, etc.

              I guess the problems was that I couldn't find it from the start page.

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

              @patrickkidd

              And just to be sure, you see it
              http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html

              P 1 Reply Last reply
              3
              • mrjjM mrjj

                @patrickkidd

                And just to be sure, you see it
                http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-example.html

                P Offline
                P Offline
                patrickkidd
                wrote on last edited by
                #6

                @mrjj said in When to use QGraphicsWidget/Item over QWidget?:

                Oh man, thanks for that example!

                https://alaskafamilysystems.com/

                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