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. Box2D integration with QGraphicsView
Forum Updated to NodeBB v4.3 + New Features

Box2D integration with QGraphicsView

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.3k Views 2 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.
  • M Offline
    M Offline
    MajidKamali
    wrote on last edited by
    #1

    Hi.
    I want to use Box2D with qgraphicsview items.
    I converted box2d cmake project to qmake pro file and added to my project tree.
    I googled a lot but there are tutorials for QML, not qgraphicsview.
    I found this post. but it's too old, does not work, and I don't understand that well :)

    I want to create a top-down project. 4 boxes that create a rectangle and some circles inside that rectangle. Then moving balls in first frame. But they don't hit the walls and go outside.

    Please help me how to map to/from box2d items and qgraphicsitems.
    I can post source code if needed.

    PS. I don't know how to map box2d rectangles to qgraphicsitems so I can't see the boxes :)

    Thanks

    1 Reply Last reply
    0
    • lajtuL Offline
      lajtuL Offline
      lajtu
      wrote on last edited by
      #2

      I join the question. Is there any example using Box2d in Qt5 that would run multiplatform ?

      https://wiki.qt.io/Box2D

      If not what is the best way to implement physics of colliding and bouncing balls that would also react to gravity ?

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

        Hi,

        There's the QML-Box2D project that can be of interest (Link fixed in the Wiki) that is cross-platform.

        However, I'm not aware of an implementation for the graphics view framework.

        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
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved