[PyQt] Qt4 vs Qt5 QAbstractItemView clicked signal

V. Armando Solé sole at esrf.fr
Wed Oct 28 13:32:29 GMT 2015


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 at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt




More information about the PyQt mailing list