Hi,
Sorry for bugging you with the same issue again.
Last week I posted a problem regarding QTableView and the triggering of
its activated signal. I didn't get any response - maybe I was too vague
in the statement of the problem?
Anyway, this time I attach a snippet that reproduces the issue. So run
the example and try to tell me why the activated signal is NOT triggered
when a cell is clicked, double-clicked, entered etc.
Best regards,
Mads
--
+-----------------------------------------------------+
| Mads Ipsen |
+----------------------+------------------------------+
| Gåsebæksvej 7, 4. tv | |
| DK-2500 Valby | phone: +45-29716388 |
| Denmark | email: [email protected] |
+----------------------+------------------------------+
import sys
from PyQt4 import QtGui, QtCore
class Table(QtGui.QTableView):
def __init__(self):
QtGui.QTableView.__init__(self)
# Hook up model
self._model = QtGui.QStandardItemModel(3,3)
self.setModel(self._model)
# Add dummy data
for i in range(3):
for j in range(3):
item = QtGui.QStandardItem('(%d,%d)' % (i,j))
self._model.setItem(i,j,item)
# Connect
self.connect(self, QtCore.SIGNAL('doubleClicked(const QModelIndex &)'), self.doubleClicked)
self.connect(self, QtCore.SIGNAL('activated(const QModelIndex &)'), self.activated)
def doubleClicked(self, index):
print 'doubleClick on cell[%d,%d]' % (index.row(), index.column())
def activated(self, index):
print 'activate on cell[%d,%d]' % (index.row(), index.column())
if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
table = Table()
table.show()
sys.exit(app.exec_())
_______________________________________________
PyQt mailing list [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt