Sets the table row count. Args: count (int): number of rows
(self, count)
| 3069 | return None |
| 3070 | |
| 3071 | def set_row_count(self, count): |
| 3072 | """Sets the table row count. |
| 3073 | |
| 3074 | Args: |
| 3075 | count (int): number of rows |
| 3076 | """ |
| 3077 | current_row_count = self.row_count |
| 3078 | current_column_count = self.column_count |
| 3079 | if count > current_row_count: |
| 3080 | cl = TableEditableItem if self._editable else TableItem |
| 3081 | for i in range(current_row_count, count): |
| 3082 | tr = TableRow() |
| 3083 | for c in range(0, current_column_count): |
| 3084 | tr.append(cl(), str(c)) |
| 3085 | if self._editable: |
| 3086 | tr.children[str(c)].onchange.connect( |
| 3087 | self.on_item_changed, int(i), int(c)) |
| 3088 | self.append(tr, str(i)) |
| 3089 | self._update_first_row() |
| 3090 | elif count < current_row_count: |
| 3091 | for i in range(count, current_row_count): |
| 3092 | self.remove_child(self.children[str(i)]) |
| 3093 | |
| 3094 | def set_column_count(self, count): |
| 3095 | """Sets the table column count. |
no test coverage detected