! * Toggles the StatisticsSpreadsheet for the current spreadsheet. * @param on Enable/disable the StatisticsSpreadsheet if true/false. */
| 1209 | * @param on Enable/disable the StatisticsSpreadsheet if true/false. |
| 1210 | */ |
| 1211 | void Spreadsheet::toggleStatisticsSpreadsheet(bool on) { |
| 1212 | Q_D(Spreadsheet); |
| 1213 | if (on) { |
| 1214 | if (d->statisticsSpreadsheet) |
| 1215 | return; |
| 1216 | |
| 1217 | d->statisticsSpreadsheet = new StatisticsSpreadsheet(this); |
| 1218 | addChildFast(d->statisticsSpreadsheet); |
| 1219 | } else { |
| 1220 | if (!d->statisticsSpreadsheet) |
| 1221 | return; |
| 1222 | |
| 1223 | setUndoAware(false); |
| 1224 | removeChild(d->statisticsSpreadsheet); |
| 1225 | setUndoAware(true); |
| 1226 | d->statisticsSpreadsheet = nullptr; |
| 1227 | } |
| 1228 | } |
| 1229 | |
| 1230 | // ############################################################################## |
| 1231 | // ################## Serialization/Deserialization ########################### |
no outgoing calls