# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'table6.ui'
#
# Created: Tue Jul 27 16:31:53 2010
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
import functools
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(465, 531)
self.
tableWidget.
setGeometry(QtCore.
QRect(20,
70,
351,
201)) self.tableWidget.setRowCount(1)
self.tableWidget.setColumnCount(3)
self.tableWidget.setObjectName("tableWidget")
self.tableWidget.setColumnCount(3)
self.tableWidget.setRowCount(1)
self.tableWidget.setHorizontalHeaderItem(0, item)
self.tableWidget.setHorizontalHeaderItem(1, item)
self.tableWidget.setHorizontalHeaderItem(2, item)
self.
comboBox.
setGeometry(QtCore.
QRect(30,
480,
61,
21)) self.comboBox.setMaxVisibleItems(2)
self.comboBox.setMaxCount(2)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.
comboBox_2.
setGeometry(QtCore.
QRect(150,
480,
121,
21)) self.comboBox_2.setMaxVisibleItems(2)
self.comboBox_2.setMaxCount(2)
self.comboBox_2.setObjectName("comboBox_2")
self.comboBox_2.addItem("")
self.comboBox_2.addItem("")
self.tableWidget.setCellWidget(0,1,self.comboBox)
self.tableWidget.setCellWidget(0,2,self.comboBox_2)
self.tableWidget.setColumnWidth(2,120)
self.
pushButton.
setGeometry(QtCore.
QRect(300,
20,
75,
25)) self.pushButton.setObjectName("pushButton")
self.
spinBox.
setGeometry(QtCore.
QRect(200,
20,
53,
22)) self.spinBox.setProperty("value", 1)
self.spinBox.setObjectName("spinBox")
self.
label = QtGui.
QLabel(Form
) self.
label.
setGeometry(QtCore.
QRect(20,
20,
141,
16)) self.label.setObjectName("label")
self.
pushButton_2.
setGeometry(QtCore.
QRect(20,
300,
91,
25)) self.pushButton_2.setObjectName("pushButton_2")
self.retranslateUi(Form)
self.comboBox.setCurrentIndex(0)
self.comboBox_2.setCurrentIndex(0)
QtCore.
QObject.
connect(self.
spinBox, QtCore.
SIGNAL("valueChanged(int)"), self.
createMyRow)
#QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
self.
tableWidget.
horizontalHeaderItem(0).
setText(QtGui.
QApplication.
translate("Form",
"Name", None, QtGui.
QApplication.
UnicodeUTF8)) self.
tableWidget.
horizontalHeaderItem(1).
setText(QtGui.
QApplication.
translate("Form",
"Type", None, QtGui.
QApplication.
UnicodeUTF8)) self.
tableWidget.
horizontalHeaderItem(2).
setText(QtGui.
QApplication.
translate("Form",
"Surface", None, QtGui.
QApplication.
UnicodeUTF8)) self.
comboBox_2.
setItemText(0, QtGui.
QApplication.
translate("Form",
"closest surface", None, QtGui.
QApplication.
UnicodeUTF8)) self.
comboBox_2.
setItemText(1, QtGui.
QApplication.
translate("Form",
"opacity filtering", None, QtGui.
QApplication.
UnicodeUTF8))
def createMyRow(self, rows):
howManyRows = self.tableWidget.rowCount()
diff = rows - howManyRows
if diff > 0:
start = howManyRows
while rows > start:
print(start)
self.tableWidget.insertRow(start)
start = start +1
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'table6.ui'
#
# Created: Tue Jul 27 16:31:53 2010
# by: PyQt4 UI code generator 4.7.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
import functools
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(465, 531)
self.tableWidget = QtGui.QTableWidget(Form)
self.tableWidget.setGeometry(QtCore.QRect(20, 70, 351, 201))
self.tableWidget.setRowCount(1)
self.tableWidget.setColumnCount(3)
self.tableWidget.setObjectName("tableWidget")
self.tableWidget.setColumnCount(3)
self.tableWidget.setRowCount(1)
item = QtGui.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(0, item)
item = QtGui.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(1, item)
item = QtGui.QTableWidgetItem()
self.tableWidget.setHorizontalHeaderItem(2, item)
self.comboBox = QtGui.QComboBox(Form)
self.comboBox.setGeometry(QtCore.QRect(30, 480, 61, 21))
self.comboBox.setMaxVisibleItems(2)
self.comboBox.setMaxCount(2)
self.comboBox.setObjectName("comboBox")
self.comboBox.addItem("")
self.comboBox.addItem("")
self.comboBox_2 = QtGui.QComboBox(Form)
self.comboBox_2.setGeometry(QtCore.QRect(150, 480, 121, 21))
self.comboBox_2.setMaxVisibleItems(2)
self.comboBox_2.setMaxCount(2)
self.comboBox_2.setObjectName("comboBox_2")
self.comboBox_2.addItem("")
self.comboBox_2.addItem("")
self.tableWidget.setCellWidget(0,1,self.comboBox)
self.tableWidget.setCellWidget(0,2,self.comboBox_2)
self.tableWidget.setColumnWidth(2,120)
self.pushButton = QtGui.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(300, 20, 75, 25))
self.pushButton.setObjectName("pushButton")
self.spinBox = QtGui.QSpinBox(Form)
self.spinBox.setGeometry(QtCore.QRect(200, 20, 53, 22))
self.spinBox.setProperty("value", 1)
self.spinBox.setObjectName("spinBox")
self.label = QtGui.QLabel(Form)
self.label.setGeometry(QtCore.QRect(20, 20, 141, 16))
self.label.setObjectName("label")
self.pushButton_2 = QtGui.QPushButton(Form)
self.pushButton_2.setGeometry(QtCore.QRect(20, 300, 91, 25))
self.pushButton_2.setObjectName("pushButton_2")
self.retranslateUi(Form)
self.comboBox.setCurrentIndex(0)
self.comboBox_2.setCurrentIndex(0)
QtCore.QObject.connect(self.spinBox, QtCore.SIGNAL("valueChanged(int)"), self.createMyRow)
#QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
Form.setWindowTitle(QtGui.QApplication.translate("Form", "Add Passes", None, QtGui.QApplication.UnicodeUTF8))
self.tableWidget.horizontalHeaderItem(0).setText(QtGui.QApplication.translate("Form", "Name", None, QtGui.QApplication.UnicodeUTF8))
self.tableWidget.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("Form", "Type", None, QtGui.QApplication.UnicodeUTF8))
self.tableWidget.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("Form", "Surface", None, QtGui.QApplication.UnicodeUTF8))
self.comboBox.setItemText(0, QtGui.QApplication.translate("Form", "color", None, QtGui.QApplication.UnicodeUTF8))
self.comboBox.setItemText(1, QtGui.QApplication.translate("Form", "bw", None, QtGui.QApplication.UnicodeUTF8))
self.comboBox_2.setItemText(0, QtGui.QApplication.translate("Form", "closest surface", None, QtGui.QApplication.UnicodeUTF8))
self.comboBox_2.setItemText(1, QtGui.QApplication.translate("Form", "opacity filtering", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton.setText(QtGui.QApplication.translate("Form", "Passes", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Form", "How many passes", None, QtGui.QApplication.UnicodeUTF8))
self.pushButton_2.setText(QtGui.QApplication.translate("Form", "Add Passes", None, QtGui.QApplication.UnicodeUTF8))
def createMyRow(self, rows):
howManyRows = self.tableWidget.rowCount()
diff = rows - howManyRows
if diff > 0:
start = howManyRows
while rows > start:
print(start)
self.tableWidget.insertRow(start)
self.comboBoxNew = QtGui.QComboBox(Form)
start = start +1
To copy to clipboard, switch view to plain text mode
Bookmarks