Edit TreeItem on single click
Asked Answered
I

2

0

Hello everyone!

I am working with a Tree node in a custom editor window opened by a custom plugin and I would like to let the user edit the columns of the TreeItem directly after clicking on it.

The editing works fine for the first click, but since the TextEdit opened by the Tree for editing a value is a Popup it will eat up the next click on another TreeItem column. I see that my custom editor windo losses focus, while editing and regains focus as soon as the editing Popup is closed because of another click.

I noticed that this does not happen, when starting the scene containing the UI via "Run Project (F5)". There every click on a TreeItem immediatelly starts editing the item and the window never looses focus.

Is there a way to configure my custom editor window in a way that the Tree node behaves the same as with "Run Project"? I did experiment with the window flags, but could not get it working yet. The custom editor window is just a Window node with the main UI scene as its only child. What flags does the window created by "Run Project" use?

Any hints and tipps for this issue would be greatly appreciated!

Thanks in advance for any input and best regards,
Patrick

Initiate answered 23/1 at 0:38 Comment(0)
S
0

Initiate
you wrote: ...Any hints and tipps for this issue would be greatly appreciated!...
ok i try, im not sure i understand your problem, but you can insert a script that grabs the focus with the command
.grab_focus() (or in C# .GrabFocus()😉 so if it was stealed you get it back...

Seidel answered 23/1 at 9:31 Comment(0)
I
0

Hello Pneumonic!

Thanks for your tip! I think the edit popup will prevent grabbing the focus this way, but I will test this.

Thanks and best regards,
Patrick

Initiate answered 25/1 at 0:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.