Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Qt3d Input in c++
Forum Updated to NodeBB v4.3 + New Features

Qt3d Input in c++

Scheduled Pinned Locked Moved Unsolved Game Development
4 Posts 3 Posters 2.3k 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.
  • njbrownN Offline
    njbrownN Offline
    njbrown
    wrote on last edited by
    #1

    Is it possible to do handle mouse input in qt3d in c++? I am able to do so using qml using a sample in the qt3d repo
    https://github.com/qtproject/qt3d/tree/5.6/examples/qt3d/mouseinput-qml
    There isnt a c++ equivalent for this however.

    I am not able to do capture mouse events in c++ at all despite numerous attempts (even trying to capture input using event filters attached to various widgets) . Is the c++ mouse input api for qt3d complete for this version of qt (5.6) or should i wait for version 5.7?

    kshegunovK Zee_07Z 2 Replies Last reply
    0
    • njbrownN njbrown

      Is it possible to do handle mouse input in qt3d in c++? I am able to do so using qml using a sample in the qt3d repo
      https://github.com/qtproject/qt3d/tree/5.6/examples/qt3d/mouseinput-qml
      There isnt a c++ equivalent for this however.

      I am not able to do capture mouse events in c++ at all despite numerous attempts (even trying to capture input using event filters attached to various widgets) . Is the c++ mouse input api for qt3d complete for this version of qt (5.6) or should i wait for version 5.7?

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

      @njbrown
      I experimented with that a few months ago, but the API has (probably) changed from then. I'm not completely sure at what state it is currently, but here's my exchange with Sean I hope it's of help. This might also be helpful.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1
      • njbrownN njbrown

        Is it possible to do handle mouse input in qt3d in c++? I am able to do so using qml using a sample in the qt3d repo
        https://github.com/qtproject/qt3d/tree/5.6/examples/qt3d/mouseinput-qml
        There isnt a c++ equivalent for this however.

        I am not able to do capture mouse events in c++ at all despite numerous attempts (even trying to capture input using event filters attached to various widgets) . Is the c++ mouse input api for qt3d complete for this version of qt (5.6) or should i wait for version 5.7?

        Zee_07Z Offline
        Zee_07Z Offline
        Zee_07
        wrote on last edited by
        #3

        @njbrown
        For capturing mouse event on any Entity in just add one component Qt3DRender::QObjectPicker() and connect this component with your slot where you want to handle mouse event .

        QObject::connect(m_objectPicker,SIGNAL(clicked(Qt3DRender::QPickEvent*)),this,SLOT(onClicked(Qt3DRender::QPickEvent*)));
        

        I hope this is what you want.

        Thanks and Kind Regards,
        Zee_07

        1 Reply Last reply
        0
        • njbrownN Offline
          njbrownN Offline
          njbrown
          wrote on last edited by
          #4

          The new qt3d update fixed the input api for c++.

          Thanks for the help guys.

          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