Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Qt3d Input in c++

    Game Development
    3
    4
    1706
    Loading More Posts
    • 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.
    • njbrown
      njbrown last edited by

      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?

      kshegunov Zee_07 2 Replies Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @njbrown last edited by kshegunov

        @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 Reply Quote 1
        • Zee_07
          Zee_07 @njbrown last edited by

          @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 Reply Quote 0
          • njbrown
            njbrown last edited by

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

            Thanks for the help guys.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post