fix resize table

master3.3
Denis Spiridonov 12 years ago
parent 0ec4819d6c
commit 935409d13b

@ -648,13 +648,13 @@ class MainFrame(QtGui.QWidget):
self.table_dict[field.name] = field
table = field.tablevalue
if len (table.body.stringArray[0].string):
lenColumn = len(table.head.string)
lenBody = len(table.body.stringArray)
else:
lenColumn = 0
lenBody = 0
lenColumn = 0
lenBody = 0
if len (table.body.stringArray):
if len (table.body.stringArray[0].string):
lenColumn = len(table.head.string)
lenBody = len(table.body.stringArray)
self.table_widget = QtGui.QTableWidget \
(lenBody, len(table.head.string), self)
@ -1052,8 +1052,9 @@ class MainFrame(QtGui.QWidget):
list_result = self.view_dict[field.name].\
cellWidget(i,j).values()
if not list_result:
list_result = [None]
text = ','.join(list_result)
text = ''
else:
text = ','.join(list_result)
elif type(self.view_dict[field.name].cellWidget(i,j)) == \
CentralCheckBox:
text = self.view_dict[field.name].cellWidget(i,j).\

@ -872,13 +872,13 @@ class PlusRow (QtGui.QWidget):
font.setWeight(QtGui.QFont.Black)
self.table.item(row, column).setFont(font)
# Resize table
h = self.table.horizontalHeader().height() + \
2 * self.table.frameWidth()
h += self.table.horizontalScrollBar().height()
for row_in_table in range (self.table.rowCount()):
h += self.table.rowHeight(row_in_table)
self.table.setFixedHeight(h)
# Resize table
h = self.table.horizontalHeader().height() + \
2 * self.table.frameWidth()
h += self.table.horizontalScrollBar().height()
for row_in_table in range (self.table.rowCount()):
h += self.table.rowHeight(row_in_table)
self.table.setFixedHeight(h)
if self.table.rowCount() == 1:
self.table.horizontalHeader().resizeSections\

Loading…
Cancel
Save