class manager_ui(QtGui.QDialog):
def __init__(self, parent=None):
QtGui.QDialog.__init__(self, parent)
self.setWindowTitle('UI Manager')
# Build the GUI
self.init_ui()
self.populate_table_data()
self.connect_signals()
self.resize(QtCore.QSize(600, 350))
def init_ui(self):
self.color_table = QtGui.QTableWidget()
self.color_table.setRowCount(5)
self.color_table.setColumnCount(2)
self.color_table.setHorizontalHeaderLabels(['Geos in Scene',
'Colors'])
self.set_color_btn = QPushButton()
...
def connect_signals(self):
self.reset_colors_btn.clicked.connect(self.reset_color)
def reset_color(self):
for row in xrange(self.variant_table.rowCount()):
self.color_table.cellWidget(row, 1).setCurrentIndex(0)
def populate_data(self):
...
self.color_combobox = QtGui.QComboBox()
self.color_combobox.addItems(list(sorted(new_itempath)))
self.color_table.setCellWidget(index, 1, self.color_combobox)
Additionally, was wondering if anyone could give me any insights on what to look out for when splitting the file into a main and a ui file?
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/fe696c48-6cc6-4a63-9fe9-acb3ae6056f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
### UI File, manager_ui.py ###
import functools
import manager_main
class manager_ui(QtGui.QDialog):
def __init__(self, parent=None):
QtGui.QDialog.__init__(self, parent)
self.setWindowTitle('UI Manager')
# Build the GUI
self.init_ui()
self.populate_table_data()
self.connect_signals()
self.resize(QtCore.QSize(600, 350))
def init_ui(self):
self.color_table = QtGui.QTableWidget()
self.color_table.setRowCount(5)
self.color_table.setColumnCount(2)
self.color_table.setHorizontalHeaderLabels(['Geos in Scene',
'Colors'])
self.set_color_btn = QPushButton()
...
def connect_signals(self):
#self.reset_colors_btn.clicked.connect(self.reset_color)
self.reset_colors_btn.clicked.connect(functools.partial(manager_main.reset_color, self.color_table))
'''
# Function is to be called in the main file
def reset_color(self):
for row in xrange(self.variant_table.rowCount()):
self.color_table.cellWidget(row, 1).setCurrentIndex(0)
'''
def populate_data(self):
...
self.color_combobox = QtGui.QComboBox()
self.color_combobox.addItems(list(sorted(new_itempath)))
self.color_table.setCellWidget(index, 1, self.color_combobox)
### Main File, manager_main.py ###
def reset_color(table):
for row in xrange(table.rowCount()):
table.cellWidget(row, 1).setCurrentIndex(0)
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0fe1980d-d9b5-436f-aa11-8174ac8b38f1%40googlegroups.com.
Well actually it will be my UI accessing the functions of Main.. I should have mentioned thath
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bfe6b28d-f53e-4611-8972-55d2357b87d7%40googlegroups.com.