qtinuum / QtnProperty

Extended properties for Qt5
Apache License 2.0
425 stars 153 forks source link

Support Tab navigation #23

Open levanhong05 opened 7 years ago

levanhong05 commented 7 years ago

Hi, Alex Zhondin.

First, thanks for your QtnProperty library. It's nice.

And can you support Tab (Shift + Tab) to navigate to input next field?

Regards, Eric.

lexxmark commented 7 years ago

Hi Eric,

Is it standard behavior somewhere? I think Tab and Shift+Tab are supposed to navigate among controls in direct and reversed order. Now in QntProperty user can press "arrow down" to move selection one item down and press "enter" or "space" to start edit.

Do you need some single shortcut for these two steps?

Regards, Alex

levanhong05 commented 7 years ago

Hi Alex,

Yes, you right. Almost software use the Tab key to navigate control (Tab in direct and Shift+Tab in reversed order). I know QtnProperty use "Arrow down/up"+"Enter" to navigate the controls. And I also try to re-implement it, but I still have to use the "Enter" key to start editing (Tab + "Enter).

So I want you help me merge them to the single shortcut.

Regards, Eric

lexxmark commented 7 years ago

OK, but Shift+Tab is reserved as standard shortcut for reversed navigation. What another keyboard combination do you want to use as "move next and edit" command?

levanhong05 commented 7 years ago

"move next and edit" = Tab "move previous and edit" = Shift+Tab

Regards, Eric

lexxmark commented 7 years ago

I meant Tab already reserved for "Go to next control" and Shift+Tab - "Go to previous control". If you press Tab while on PropertyWidget now You will switch focus to the next control on the form.

You should choose other shortcuts.

levanhong05 commented 7 years ago

OK, I meant.

"move next and edit" = Ctrl+Tab "move previous and edit" = Ctrl+Shift+Tab

Regards, Eric

lexxmark commented 7 years ago

OK

lexxmark commented 7 years ago

After some thinking I realize it's hard to implement now.

There are several possibilities for every property delegate:

  1. Delegate doesn't support any input popup widget (like delegate for PropertyBool that directly handles mouse clicks and key presses). How Ctrl+Tab should work in this case?

  2. Delegate has one QtnSubItem object that has input widget (for example delegate for PropertyFloat). Ctrl+Tab should activate input widget. Simple case.

  3. Delegate has several QtnSubItem objects with different input widgets (I don't have such delegates now but can imagine something like PropertyDate where user can activate day, month or year widget independently). How Ctrl+Tab should work in this case?

  4. Complex delegates (PropertySet, PropertyFont, PropertyEnumFlags ...) that have sub-properties. How Ctrl+Tab should work in this case?

So I know only solution for case 2 and have no any clear and simple solution for other cases.

What do you think?

P.S. If it hard to understand what I wrote I can make some pictures to illustrate my ideas.