[Interest] What did I do?

Bill Crocker william.crocker at analog.com
Wed Sep 5 14:37:06 CEST 2012


On 09/05/2012 08:22 AM, Tony Rietwyk wrote:
> 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?
>

... "when I click in a section of the horizontal header" ...

Widget:     QTableView
Qt version: 4.7.1
OS:         Linux

Thanks.

Bill

> Regards,
>
> Tony
>
> *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?
>
> Hi,
>
> 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 view,
>
>>  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
>
> Konrad
>




More information about the Interest mailing list