views.clean_data.table_logic
autosize_columns(widget)
Resize all columns so that cell contents become visible.
Source code in src/views/clean_data/table_logic.py
91 92 93 | |
delete_cols(widget, cols)
Remove all columns listed in cols.
Steps
- Iterate over cols in reverse order so indices remain valid.
- Remove each column from the widget.
- Resize columns afterward for cleanliness.
Source code in src/views/clean_data/table_logic.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
delete_rows(widget, rows)
Remove all rows listed in rows.
Steps
- Iterate over rows in reverse order so indices remain valid.
- Remove each row from the widget.
- Resize columns afterward for cleanliness.
Source code in src/views/clean_data/table_logic.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
fill_table(widget, data)
Replace the entire table with the provided 2D list.
Steps
- Clear any existing contents from widget.
- Resize the table to match data.
- Insert each cell value into the table widget.
- Resize columns so values are fully visible.
Source code in src/views/clean_data/table_logic.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
get_table_data(widget)
Return the table contents as a list of rows.
Steps
- Iterate over every row and column of widget.
- Collect the text of each cell (empty string if no item).
- Assemble and return the resulting two-dimensional list.
Source code in src/views/clean_data/table_logic.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
insert_col(widget)
Insert an empty column at the current position.
Steps
- Determine the current column index; append to end if none selected.
- Insert a new empty column and resize columns.
Source code in src/views/clean_data/table_logic.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
insert_row(widget)
Insert an empty row at the current position.
Steps
- Determine the current row index; append to bottom if no selection.
- Insert a new empty row and resize columns.
Source code in src/views/clean_data/table_logic.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
transpose_data(data)
Return a transposed copy of the provided data.
Steps
- Use zip(*data) to swap rows and columns.
- Convert the tuples back into lists.
Source code in src/views/clean_data/table_logic.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
transpose_table(widget)
Transpose the table if it contains any data.
Steps
- Extract current data with get_table_data.
- If the table is not empty, fill it again with the transposed data.
Source code in src/views/clean_data/table_logic.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
update_table_data(widget, data)
Update the table in place to match the given data.
Steps
- Iterate through data row by row.
- Create missing QTableWidgetItem objects as needed.
- Update text of existing items only when it differs to avoid flicker.
- Call 'autosize_columns' afterward to adjust column widths.
Source code in src/views/clean_data/table_logic.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | |