[Interest] temp disable any selection changing in TableView?

David M. Cotter dave at kjams.com
Wed Jul 22 16:47:48 CEST 2020


i'm not sure if i was clear.  this is for Qt Widgets, not Qt Quick.

i'm talking about preventing the table view from changing selection, even while popping up a menu, or editing a text on a selected or a NOT selected row.

i'm not talking about selection within a text edit, which obviously would have to continue to function as expected, but while NOT changing the selection within the row of the table view

same if the column in the row shows a checkbox.  i don't want the checkbox itself to "gain focus", i just want it to be checked or unchecked, without changing the row selection in the table view.

> On Jul 22, 2020, at 7:40 AM, Mitch Curtis <mitch.curtis at qt.io> wrote:
> 
> TextEdit has a persistentSelection property:
> 
> https://doc.qt.io/qt-5/qml-qtquick-textedit.html#persistentSelection-prop
> 
> If the item you're referring to is a text input item, you can set that property to true.
> 
> If the item you're referring to is derived from Control, then you have focusPolicy, which you can set to Qt.NoFocus. That will prevent the control from getting focus automatically though.
> 
>> -----Original Message-----
>> From: Interest <interest-bounces at qt-project.org> On Behalf Of David M.
>> Cotter
>> Sent: Wednesday, 22 July 2020 4:32 PM
>> To: Qt Interest <Interest at qt-project.org>
>> Subject: [Interest] temp disable any selection changing in TableView?
>> 
>> 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