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. Is it possible to send mouse input from QFrame to Qt3DWindow?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to send mouse input from QFrame to Qt3DWindow?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 414 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.
  • A Offline
    A Offline
    Argostin
    wrote on last edited by
    #1

    Hi there,
    Is it possible to take the mouse input information gathered from a QFrame object and send it to a Qt3DWindow object with similar size (width and height), in a way that will make possible for the Qt3DWindow object to perform object picking.
    Something like a touchpad and a screen.

    Pl45m4P 1 Reply Last reply
    0
    • A Argostin

      Hi there,
      Is it possible to take the mouse input information gathered from a QFrame object and send it to a Qt3DWindow object with similar size (width and height), in a way that will make possible for the Qt3DWindow object to perform object picking.
      Something like a touchpad and a screen.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Argostin

      Yes, should be possible. You can take the coords from your clicks / movement on your QFrame and give them to a raycast / object picker.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • A Offline
        A Offline
        Argostin
        wrote on last edited by
        #3

        Thanks for the response @Pl45m4
        But where exactly should I send the coords, to a Qt3DWindow method or to the method of some object somewhere inside the Qt3DWindow object?

        Pl45m4P 1 Reply Last reply
        0
        • A Argostin

          Thanks for the response @Pl45m4
          But where exactly should I send the coords, to a Qt3DWindow method or to the method of some object somewhere inside the Qt3DWindow object?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #4

          @Argostin

          It's up to you and depends on your structure and how your input looks like.

          For example, you can have a function/slot in your Qt3DWindow and create a QRayCaster / QScreenRayCaster there with your point / vector.

          • https://doc.qt.io/qt-5/qt3drender-qscreenraycaster.html
          • https://doc.qt.io/qt-5/qt3drender-qraycaster.html
          • https://doc.qt.io/qt-5/qt3drender-qobjectpicker.html

          Probably you have to convert your QFrame point to some vector / direction to make it work, since QObjectPicker as well as QRayCaster both take vectors to fire the ray in this direction and check for collisions afterwards.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          A 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @Argostin

            It's up to you and depends on your structure and how your input looks like.

            For example, you can have a function/slot in your Qt3DWindow and create a QRayCaster / QScreenRayCaster there with your point / vector.

            • https://doc.qt.io/qt-5/qt3drender-qscreenraycaster.html
            • https://doc.qt.io/qt-5/qt3drender-qraycaster.html
            • https://doc.qt.io/qt-5/qt3drender-qobjectpicker.html

            Probably you have to convert your QFrame point to some vector / direction to make it work, since QObjectPicker as well as QRayCaster both take vectors to fire the ray in this direction and check for collisions afterwards.

            A Offline
            A Offline
            Argostin
            wrote on last edited by
            #5

            Thanks, @Pl45m4
            I used QScreenRayCaster as an added component in the root entity and it works!

            1 Reply Last reply
            2

            • Login

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