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. Mouse drag on specific area.
QtWS25 Last Chance

Mouse drag on specific area.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.1k 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.
  • H Offline
    H Offline
    heatblazer
    wrote on last edited by
    #1

    Hello, Im doing it again. Next game with another challenge for my 1 month Qt expirience. I have to make a train moving on the trails: https://www.flickr.com/photos/heatblazer/15453957743/ The picture shows the trails. The user must drag the train in the exact trails, no other space. Ive predefined invisible curves to match the rails so collision deteciton is OK. But this is the test picture, the final one will have a choice of the roads so I need to know what classes will I need. Just point me the way, I`ll to it on my own from there on.

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

      Hi,

      Sounds like you should either use the QGraphicsScene framework or QML

      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
      • H Offline
        H Offline
        heatblazer
        wrote on last edited by
        #3

        I am using QGraphicsScene. The queston is if there is an API to move the train on the rails with curves so if user drags up and there is a curved rail, the train must curve there too even the mouse is not.
        [quote author="SGaist" date="1419200763"]Hi,

        Sounds like you should either use the QGraphicsScene framework or QML[/quote]

        1 Reply Last reply
        0
        • H Offline
          H Offline
          heatblazer
          wrote on last edited by
          #4

          If I can add invisible boundries, will the user be forced to curve to them? I wonder.

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

            Makes me think of "collidesWithPath":http://doc.qt.io/qt-5/qgraphicsitem.html#collidesWithPath

            Note that I haven't used it

            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

            • Login

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