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

List:       pykde
Subject:    Re: [PyQt] Qt4 vs Qt5 QAbstractItemView clicked signal
From:       "=?UTF-8?Q?V._Armando_Sol=c3=a9?=" <sole () esrf ! fr>
Date:       2015-10-28 13:32:29
Message-ID: 5630CE6D.5050901 () esrf ! fr
[Download RAW message or body]

Solved.

I implemented mousePressEvent(self, e)  and obtained the QModelIndex 
calling self.indexAt(e.pos())

Armando

On 28/10/2015 12:38, V. Armando Solé wrote:
> Hello,
>
> I am porting an application from PyQt4 to PyQt5 and I have the 
> following problem.
>
> The signature of QAbstractItemView.clicked signal is the same:
>
> void QAbstractItemView::clicked(const QModelIndex & index)
>
> but in Qt4 the signal is generated on any mouse button click, while on 
> Qt5 the signal is generated only on left click.
>
> Is there a way I can achieve the same behavior?
>
> I can implement mousePressEvent to know the pressed mouse button, but 
> that does not give me the QModelIndex.
>
> Thanks for your time,
>
> Armando
>
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt


_______________________________________________
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