[Qt-interest] how to prevent selecting multiple columns in a QTableView

Andy Hirsh andhirsh at gmail.com
Thu Oct 28 17:51:01 CEST 2010


Hello Sean

  not sure I have sufficient skill to do this in the right way.

  I play with currentColumnChanged() signal and with selectionmodel for
hours, but without any good results...

  I'll try again in the next days, but for now I have to giveup :-(

  I was hoping it was just a mistake in the way I manage the selection...

                 Andy


On Thu, Oct 28, 2010 at 5:29 PM, Sean Harmer <
sean.harmer at maps-technology.com> wrote:

> Hi,
>
> On Thursday 28 October 2010 16:24:45 Andy Hirsh wrote:
> > Hello Samuel
> >
> >   mmm... maybe I'm doing something wrong, but I was not able to set this
> > behaviour using the two functions you talk about; what I need is to allow
> > multiple item selection, but only if they are on the same column.
> >
> > note that setting:
> >
> >    tableView->setSelectionBehavior(QAbstractItemView::SelectColumns);
> >
> > will select always the entire column, while I want to be able to select
> > only part of it...
>
> You may need to create a new view that inherits QTableView and add a new
> selection behaviour that does what you need in this case since none of the
> standard ones support quite what you need (I think).
>
> Or even better, file a merge request through gitorious that adds this mode
> to
> the standard QTableView as I can see times when it would be handy. This
> way,
> everybody will benefit from it.
>
> Good luck,
>
> Sean
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101028/0ac2306c/attachment.html 


More information about the Qt-interest-old mailing list