* \class Worksheet * \brief Top-level container for worksheet elements like plot, labels, etc. * * The worksheet is, besides the data containers \c Spreadsheet and \c Matrix, another central part of the application * and provides an area for showing and grouping together different kinds of worksheet objects - plots, labels &etc; * * \ingroup worksheet */
| 50 | * \ingroup worksheet |
| 51 | */ |
| 52 | Worksheet::Worksheet(const QString& name, bool loading) |
| 53 | : AbstractPart(name, AspectType::Worksheet) |
| 54 | , d_ptr(new WorksheetPrivate(this)) { |
| 55 | Q_D(Worksheet); |
| 56 | d->background = new Background(QStringLiteral("background")); |
| 57 | addChild(d->background); |
| 58 | d->background->setHidden(true); |
| 59 | connect(d->background, &Background::updateRequested, [=] { |
| 60 | d->update(); |
| 61 | }); |
| 62 | |
| 63 | connect(this, &Worksheet::childAspectAdded, this, &Worksheet::handleAspectAdded); |
| 64 | connect(this, &Worksheet::childAspectAboutToBeRemoved, this, &Worksheet::handleAspectAboutToBeRemoved); |
| 65 | connect(this, &Worksheet::childAspectRemoved, this, &Worksheet::handleAspectRemoved); |
| 66 | connect(this, &Worksheet::childAspectMoved, this, &Worksheet::handleAspectMoved); |
| 67 | |
| 68 | if (!loading) |
| 69 | init(); |
| 70 | } |
| 71 | |
| 72 | Worksheet::~Worksheet() { |
| 73 | delete d_ptr; |