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. Qt3D ObjectPicker hover doesn't work inside Scene3D
Qt 6.11 is out! See what's new in the release blog

Qt3D ObjectPicker hover doesn't work inside Scene3D

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qt3d qml scene3
3 Posts 2 Posters 1.6k 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.
  • F Offline
    F Offline
    FSXAC
    wrote on last edited by
    #1

    Hi,

    I have a Qt Quick Controls application with a Scene3D type. Inside contains all the usual Qt3D standard types. However I noticed the "entered" and "exited" events of ObjectPicker only trigger when I hold down my mouse button while moving the mouse.

    I have the hoverEnabled property set to true, so what is happening here? I enclosed the block of code below. Your help would be appreciated.

    Thanks in advance.

    ApplicationWindow {
        visible: true
        width: 640; height: 480
    
        Scene3D {
            anchors.fill: parent
            aspects: ["input", "logic"]
            Entity {
                Camera {
                    id: camera
                    projectionType: CameraLens.PerspectiveProjection
                    fieldOfView: 45
                    aspectRatio: 16/9
                    nearPlane : 0.1
                    farPlane : 1000.0
                    position: Qt.vector3d( 0.0, 0.0, -40.0 )
                    upVector: Qt.vector3d( 0.0, 1.0, 0.0 )
                    viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
                }
    
                OrbitCameraController { camera: camera }
    
                components: [
                    RenderSettings {
                        activeFrameGraph: ForwardRenderer {
                            clearColor: Qt.rgba(0.0, 0.0, 0.0, 0.0)
                            camera: camera
                        }
                    },
                    InputSettings { }
                ]
    
                PhongMaterial { id: material }
                SphereMesh { id: sphereMesh; radius: 1 }
                ObjectPicker {
                    id: objPicker
                    hoverEnabled: true
                    onEntered: console.log("enter")
                    onExited: console.log("leave")
                }
                Entity {
                    id: sphereEntity
                    components: [ sphereMesh, material, objPicker ]
                }
            }
        }
    }
    
    1 Reply Last reply
    0
    • DabullaD Offline
      DabullaD Offline
      Dabulla
      wrote on last edited by
      #3

      It works with scene3D.hoverEnabled set to true.
      I accidentally used the "onMoved" signal instead of "onContainsMouseChanged" in my own code.

      1 Reply Last reply
      1
      • DabullaD Offline
        DabullaD Offline
        Dabulla
        wrote on last edited by
        #2

        I have the same problem.
        Scene3D also has a "hoverEnabled" property (but it does not (yet) work).

        1 Reply Last reply
        0
        • DabullaD Offline
          DabullaD Offline
          Dabulla
          wrote on last edited by
          #3

          It works with scene3D.hoverEnabled set to true.
          I accidentally used the "onMoved" signal instead of "onContainsMouseChanged" in my own code.

          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