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. QGraphicsScene borders ?

QGraphicsScene borders ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qgraphicssceneqgraphicsitemborderscollisions
3 Posts 2 Posters 1.9k 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.
  • W Offline
    W Offline
    Walux
    wrote on last edited by Walux
    #1

    Hi Qt community ,

    What's the safest and shortest in code way to catch colliding between a QGraphicsItem and the borders of the QGraphicsScene ?

    I don't believe that manually declaring the borders one by one is the best way to do it .

    Thanks for your comprehension ;)

    Taking things from beginning to end : That's my entertainment !

    Joel BodenmannJ 1 Reply Last reply
    0
    • W Walux

      Hi Qt community ,

      What's the safest and shortest in code way to catch colliding between a QGraphicsItem and the borders of the QGraphicsScene ?

      I don't believe that manually declaring the borders one by one is the best way to do it .

      Thanks for your comprehension ;)

      Joel BodenmannJ Offline
      Joel BodenmannJ Offline
      Joel Bodenmann
      wrote on last edited by Joel Bodenmann
      #2

      As far as I know there is no "built-in" way to do this.
      My approach would be to create four QGraphicsLineItems and arrange them along the borders of the scene.
      If you want them to be invisible you can simply set the opacity to 0.

      Industrial process automation software: https://simulton.com
      Embedded Graphics & GUI library: https://ugfx.io

      W 1 Reply Last reply
      0
      • Joel BodenmannJ Joel Bodenmann

        As far as I know there is no "built-in" way to do this.
        My approach would be to create four QGraphicsLineItems and arrange them along the borders of the scene.
        If you want them to be invisible you can simply set the opacity to 0.

        W Offline
        W Offline
        Walux
        wrote on last edited by
        #3

        @Joel-Bodenmann
        That's the manual way i talked about uptop but thanks anyways :)
        It reassures me that i'm not "re-inventing" the wheel by applying this method .

        Taking things from beginning to end : That's my entertainment !

        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