[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Easy Question - How to use selectionChanged on a QTreeView?
From:       Richie Ward <richies () gmail ! com>
Date:       2016-11-20 23:06:11
Message-ID: CANLZi5HTzQF7RiMShVLo=y+qZyY2PrEF8rHyyHDX83678zbxww () mail ! gmail ! com
[Download RAW message or body]

Thanks, that solved my problem! I didn't think of trying that.

On 20 November 2016 at 22:33, Florian Bruhin <me@the-compiler.org> wrote:
> * Richie Ward <richies@gmail.com> [2016-11-20 22:27:13 +0000]:
>> As I understand it, I have to use
>> setSelectionModel(MySelectionModel()) and subclass
>> QItemSelectionModel. I can then override selectionChanged. My attempts
>> to do this have resulted in this error:
>> QAbstractItemView::setSelectionModel() failed: Trying to set a
>> selection model, which works on a different model than the view.
>
> That's a signal, so you should be able to simply do:
>
>     view.selectionModel().selectionChanged.connect(selection_changed)
>
> And then handle it in there, without subclassing anything.
>
> Florian
>
> --
> http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP)
>    GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
>          I love long mails! | http://email.is-not-s.ms/
>
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt



-- 
Thanks, Richie Ward
https://uk.linkedin.com/in/richie-ward-07ab0495
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic