Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Not sure: off screen drawing? in c++?
Forum Updated to NodeBB v4.3 + New Features

Not sure: off screen drawing? in c++?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 2 Posters 690 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.
  • J Offline
    J Offline
    JulienD
    wrote on last edited by
    #1

    Hello,

    For my application, I need to test different solutions off screen .
    Think of it like a puzzle (but my app is not about it): I create the puzzle off screen, make a lot of tests with collisions (boundingRect..), shapes, transforms and when satisfied with the result, send it to a canvas or whatever so that the user sees it.
    It doesn't matter how long it takes as far as it is not longer than 10 seconds (the user is presented with a waiting animation).

    I read that QtQuick is better than QPainter but is it able to fulfill my need (offscreen test)?

    New to it.

    Thank you!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JulienD
      wrote on last edited by JulienD
      #2

      I think I will use the c++ QQuickPainted API or a widget QGraphicScene (to handle collisions) to set and test my elements up, give back a QVariant to QML describing those elements and dynamically draw in QML..

      1 Reply Last reply
      0
      • GrecKoG Offline
        GrecKoG Offline
        GrecKo
        Qt Champions 2018
        wrote on last edited by
        #3

        Have you looked at Box2D to analyze collisions between shapes, that's what I would use instead of painting stuff like QQuickPaintedItem or QGraphicsScene.

        J 1 Reply Last reply
        1
        • GrecKoG GrecKo

          Have you looked at Box2D to analyze collisions between shapes, that's what I would use instead of painting stuff like QQuickPaintedItem or QGraphicsScene.

          J Offline
          J Offline
          JulienD
          wrote on last edited by JulienD
          #4

          @GrecKo interesting; what class do you draw shapes with?

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JulienD
            wrote on last edited by
            #5

            haha, it seems that I can't create a graphicscene inside my qtquick app because it will lead to a crash.

            It would have been very convenient to use that class for collision detection though..

            1 Reply Last reply
            0
            • J Offline
              J Offline
              JulienD
              wrote on last edited by JulienD
              #6

              box2D is the answer :)
              I will mark this post as answered when my test will be done

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JulienD
                wrote on last edited by
                #7

                Actually, I decided to go the QRect route and ask for the intersects method with local objects for performance reasons.

                As for the translations/rotations I created my methods.

                Subject closed!

                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