did you find a solution? because i need this...
actually i am trying to add a string into a QListWidget but i am new to QT and i don't know how to do it, here is my code
am writing in python
#!/usr/bin/env python
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
def __init__(self):
lb.doubleClicked.connect(self.someMethod)
grid.addWidget(lb, 0, 0)
def someMethod(self):
print "It happened!"
form = MainWindow()
form.show()
app.exec_()
#!/usr/bin/env python
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class MainWindow(QMainWindow):
def __init__(self):
QMainWindow.__init__(self)
lb = QListWidget()
QListWidget.addItem(self, hello)
lb.doubleClicked.connect(self.someMethod)
grid = QGridLayout()
grid.addWidget(lb, 0, 0)
def someMethod(self):
print "It happened!"
app = QApplication(sys.argv)
form = MainWindow()
form.show()
app.exec_()
To copy to clipboard, switch view to plain text mode
Bookmarks