Skip to content

Get the selected item key outside Madcad View ... #25

Answered by jimy-byerley
jlvila asked this question in Q&A
Discussion options

You must be logged in to vote

Hello !

Glad you reached out to the code and understood its architecture :)
The way to receive events for an object in the scene (a rendering.Display instance) is to override its control method
You can take a look at the way its used in

Display.control(view, key, sub, event) works just like a regular Qt event handler method, it receives an event and can choose to accept or ignore it. If it is ignored, the event will be sent over to the display's eventual children in the scene (corresponding to a sub-key), until it is accepted

You can alternatively override the view widget's method View.inputEvent to set a global behavior not specific to a Display

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jlvila
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants