Zicandar
17th May 2016, 13:33
Hello!
I have tired googling this for a while, but been unsuccessful in finding any answer. (Or really anyone asking the same question). What I have found are selection policies and selection modes. But all this is for within a widget.
www.qtcentre.org/threads/57813-Have-a-single-selection-of-item-between-2-QListWidgets does not help me as I will have to many lists. Worst case I can solve it that way, but preferably not.
What I want to achieve is across multiple widgets a single selection across multiple QListViews. So if I select an item in a different list it will deselect all previous items.
What I need is the following:
Across all widgets only a single selection should be shown. I'm using a delegate so relying on focus instead of selection is ok.
If I select an item in a list in a different widget, then when I go back to the item I had previously selected it should give me a callback. (This works if I use selectionChanged + clearing selection on focusOutEvent).
Focus seems like it might be the solution, but also there I have tried to use focusOutEvent and focusInEvent to clear the selection/focus. But I have still not managed to get the result I want. (If I clear selection on focusOutEvent it won't have any selection at all it seems like).
Help would be much appriciated!
I have tired googling this for a while, but been unsuccessful in finding any answer. (Or really anyone asking the same question). What I have found are selection policies and selection modes. But all this is for within a widget.
www.qtcentre.org/threads/57813-Have-a-single-selection-of-item-between-2-QListWidgets does not help me as I will have to many lists. Worst case I can solve it that way, but preferably not.
What I want to achieve is across multiple widgets a single selection across multiple QListViews. So if I select an item in a different list it will deselect all previous items.
What I need is the following:
Across all widgets only a single selection should be shown. I'm using a delegate so relying on focus instead of selection is ok.
If I select an item in a list in a different widget, then when I go back to the item I had previously selected it should give me a callback. (This works if I use selectionChanged + clearing selection on focusOutEvent).
Focus seems like it might be the solution, but also there I have tried to use focusOutEvent and focusInEvent to clear the selection/focus. But I have still not managed to get the result I want. (If I clear selection on focusOutEvent it won't have any selection at all it seems like).
Help would be much appriciated!