[PyQt] using itemDoubleClicked with pyqt
Christopher M. Nahler
christopher.nahler at papermodels.at
Wed Jun 23 09:29:00 BST 2010
On 23.06.2010 09:46, Phil Thompson wrote:
> On Wed, 23 Jun 2010 09:40:09 +0200, "Christopher M. Nahler"
> <christopher.nahler at papermodels.at> wrote:
>> I have problems using a signal. In the code below I create a QListWidget
>> where I would like to act upon doubleClicking an item.
>> In the documentation I have found the signal "itemDoubleClicked".
>> But somehow I am not using it right. What am I doing wrong?
>> thanks in advance
>> import sys
>> from PyQt4.QtCore import *
>> from PyQt4.QtGui import *
>> itemList = ["One",
>> class ListDlg(QDialog):
>> def __init__(self, name, parent=None):
>> super(ListDlg, self).__init__(parent)
>> self.myList = QListWidget()
>> layout = QHBoxLayout()
>> self.connect(self.myList, SIGNAL("itemDoubleClicked(*item)"),
>> def processItem(self, item):
>> if __name__ == "__main__":
>> app = QApplication(sys.argv)
>> form = ListDlg("Listdialog")
> The signal signature is "itemDoubleClicked(QListWidgetItem *)"
The way I understand this is that the signal passes a pointer to an
item, right? So what is the correct way to setup the connection? I have
tried with SIGNAL("itemDoubleClicked(item*)" and
SIGNAL("itemDoubleClicked(item *)" but that also did not work.
More information about the PyQt