[Interest] temp disable any selection changing in TableView?

Tony Rietwyk tony at rightsoft.com.au
Wed Jul 22 18:01:38 CEST 2020


Hi dave,

The selection is normally handled by an internally allocated 
QSelectionModel, which maintains the current item separate from the 
selections.  You can replace the selection model if necessary.  In this 
case, you want the current item to change, but not the selections, 
depending on which column was clicked, or whatever other condition.  You 
may need to override the view and/or change the selection model to 
intercept the calls between them.  Then you modify the parameters to 
force them to only change the current.

Good luck!   ;O)


On 23/07/2020 12:32 am, David M. Cotter wrote:

> my developer is reporting difficulty suppressing selection changes in a TableView, when attempting to edit an item.
>
> is there a way to say "hey tableview, do NOT change the selection for a bit while i do something" ?
>
> eg: one of my columns has a popup menu.
>
> if i select row 5, then i want to click the popup in row 4, i do NOT want the selection to change. i want to change the popup in row 4 and leave row 5 selected.
>
> same if i want to edit text.
>
> is this even possible?
>
> -dave
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest


More information about the Interest mailing list