# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled2.ui'
#
# Created: Fri Aug 31 04:05:57 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8
= QtCore.
QString.
fromUtf8except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object:(
def setupUi(self, Form:(
Form.setObjectName(_fromUtf8("Form"))
Form.resize(658, 527)
self.
pushButton.
setGeometry(QtCore.
QRect(170,
260,
89,
27)) self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.
listWidget.
setGeometry(QtCore.
QRect(150,
20,
256,
192)) self.listWidget.setObjectName(_fromUtf8("listWidget"))
self.retranslateUi(Form)
QtCore.
QObject.
connect(self.
pushButton, QtCore.
SIGNAL(_fromUtf8
("clicked()")), self.
selectFile)
def retranslateUi(self, Form:(
__sortingEnabled = self.listWidget.isSortingEnabled()
self.listWidget.setSortingEnabled(False)
self.listWidget.setSortingEnabled(__sortingEnabled)
def selectFile(self:(
for x in range(0,5:(
self.listWidget.addItem(item)
self.listWidget.item = self.listWidget.item(x)
print("Worked for x="+str(x))
if __name__ == "__main__":
import sys
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'untitled2.ui'
#
# Created: Fri Aug 31 04:05:57 2012
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
_fromUtf8 = lambda s: s
class Ui_Form(object:(
def setupUi(self, Form:(
Form.setObjectName(_fromUtf8("Form"))
Form.resize(658, 527)
self.pushButton = QtGui.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(170, 260, 89, 27))
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.listWidget = QtGui.QListWidget(Form)
self.listWidget.setGeometry(QtCore.QRect(150, 20, 256, 192))
self.listWidget.setObjectName(_fromUtf8("listWidget"))
self.retranslateUi(Form)
QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.selectFile)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form:(
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Form", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("Form", "PushButton", None, QtGui.QApplication.UnicodeUTF8))
__sortingEnabled = self.listWidget.isSortingEnabled()
self.listWidget.setSortingEnabled(False)
self.listWidget.setSortingEnabled(__sortingEnabled)
def selectFile(self:(
for x in range(0,5:(
item=QtGui.QListWidgetItem()
self.listWidget.addItem(item)
self.listWidget.item = self.listWidget.item(x)
self.listWidget.item.setText(QtGui.QApplication.translate("Form", str(x), None, QtGui.QApplication.UnicodeUTF8))
print("Worked for x="+str(x))
if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Form = QtGui.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
Bookmarks