Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-54067

MouseHandler does not work if MouseDevice is child of non-root Entity

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.7.0 RC
    • Qt3D
    • None
    • Qt3D commit 6cf83207ee249c2b25b6ee32d8b09c83116c9cf0
      Ubuntu 16.04
      Nvidia 361.42
    • 9cf9f631f89f9de8c603606d11d47e72d10a6ee7

    Description

      If the sourceDevice property of MouseHandler is set to a MouseDevice that is not a child of the root entity, the MouseHandler doesn't work. The following code illustrates the problem:

      import QtQuick.Scene3D 2.0
      import Qt3D.Core 2.0
      import Qt3D.Logic 2.0
      import Qt3D.Input 2.0
      import Qt3D.Render 2.0
      import Qt3D.Extras 2.0
      import QtQuick.Window 2.2 as QQW
      import QtQuick 2.5 as QQ2
      
      QQW.Window {
          visible: true
          width: 640
          height: 480
      
          Scene3D {
              anchors.fill: parent
              aspects: ["input", "render", "logic"]
      
              Entity {
                  components: [
                      RenderSettings {
                          activeFrameGraph: ForwardRenderer {
                              camera: Camera {}
                          }
                      },
                      InputSettings {}
                  ]
      
                  Entity {
                      // this doesn't work with the MouseHandler when placed here
                      MouseDevice {
                          id: mouseDevice
                      }
                      components: [
                          MouseHandler {
                              sourceDevice: mouseDevice
      
                              onReleased: {
                                  console.log(mouse.x, mouse.y)
                              }
                          }
                      ]
                  }
              }
          }
      }
      

      Attachments

        Activity

          People

            lemire_p Paul Lemire
            dragly Svenn-Arne Dragly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: