[PyQt] QTableView doubleClicked and clicked events do not work together

IloChab ilochab at gmail.com
Wed Jul 8 20:58:10 BST 2009


I'm using :
            Python 2.6
            Qt 4.5.0
            PyQt 4.4.4
on a Fedora 11

I'm trying to use both   clicked and  doubleClicked events on a QTableView.
This is the code:

        QtGui.QTableView.__init__(self,  wdg)
        self.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
        self.setSelectionBehavior(QtGui.QAbstractItemView.SelectItems)
        self.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.connect(self, QtCore.SIGNAL("doubleClicked(const QModelIndex
&)"),
                        self.OnItemDoubleClicked)
        self.connect(self, QtCore.SIGNAL("clicked(const QModelIndex &)"),
                        self.OnItemClicked)

I can get only the 'clicked' event to work, but if I comment the second
connect (the 'clicked' one) I get the 'doubleClicked' event to work.
It  seems that they can't work together.

I found similar problems on the net (
http://www.qtcentre.org/forum/p-qtableview-doubleclicked-event-not-working-post95980/postcount7.html)
but no solution at all.

Thanks in advance for your help.
ciao
Licia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20090708/044e0caa/attachment.html


More information about the PyQt mailing list