I have a PyQt QListView object, and I want the method to run on double-click. This should be trivial, but it doesn't seem to work. My code is as follows:
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
lb = QListView()
self.connect(lb, SIGNAL('doubleClicked()'), self.someMethod)
grid = QGridLayout()
grid.addWidget(lb, 0, 0)
centralWidget.setLayout(grid)
def someMethod(self):
print "It happened!"
Ive tried the "clicked ()" and "entered ()" methods, but they also don't work. All these events are listed in the documentation: http://bit.ly/govx1h
source
share