[Interest] What did I do?

Tony Rietwyk tony at rightsoft.com.au
Wed Sep 5 14:22:06 CEST 2012

Hi Konrad, 


I agree that those properties apply to clicking on the table cells.  


But I think the OP is referring to QHeaderView.  The only behaviours
documented are dragging, resizing and highlighting the sections.  Other
behaviours such as selecting cells, or changing the sorting, you have to
code yourself in the appropriate slots.  


Bill,  are you referring to QTableView or QTableWidget?   Which Qt version
and OS version are you seeing this behaviour on? 







From: interest-bounces+tony=rightsoft.com.au at qt-project.org
[mailto:interest-bounces+tony=rightsoft.com.au at qt-project.org] On Behalf Of
Konrad Rosenbaum
Sent: Wednesday, 5 September 2012 4:44 PM
To: interest at qt-project.org
Subject: Re: [Interest] What did I do?




On Wednesday 05 September 2012 00:37:11 Bill Crocker wrote:

> What did I do?


Nothing. This is the default.


> In my app, when I click in a section of the horizontal header a table

> all items in the corresponding column are selected.


> Is this a default behavior?

> Must I have done something to enable this behavior?


The default is to allow multiple cells to be selected at the same time:


* click on cell: select this cell

* click on row header: select the entire row

* click on column header: select the entire column

* no meta keys pressed at that time: deselect current selection and make
fresh selection

* Shift pressed: make it a range selection spanning from the last selected
cell to the new one

* Ctrl pressed: add to the existing selection


> How do I turn off this behavior?


Chose a different selection behavior, see
QAbstractItemView::SelectionBehavior and ...::SelectionMode for details.


The default is a Behavior of SelectItems and a Mode of ExtendedSelection





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120905/73abc177/attachment.html>

More information about the Interest mailing list