Krita

DockWidget.cpp
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6#include "DockWidget.h"
7#include <QDebug>
8
9#include <KoCanvasBase.h>
10
11#include "Canvas.h"
12
13struct DockWidget::Private {
14 Private() {}
15
16 Canvas *canvas {0};
17};
18
19DockWidget::DockWidget()
20 : QDockWidget()
21 , d(new Private)
22{
23}
24
25DockWidget::~DockWidget()
26{
27 delete d;
28}
29
31{
32 return d->canvas;
33}
34
35void DockWidget::setCanvas(KoCanvasBase* canvas)
36{
37 delete d->canvas;
38 d->canvas = new Canvas(canvas);
39 canvasChanged(d->canvas);
40}
41
42void DockWidget::unsetCanvas()
43{
45 delete d->canvas;
46 d->canvas = 0;
47}
Canvas wraps the canvas inside a view on an image/document.
Definition Canvas.h:23
Canvas * canvas() const
@return the canvas object that this docker is currently associated with
virtual void canvasChanged(Canvas *canvas)=0
canvasChanged is called whenever the current canvas is changed in the mainwindow this dockwidget inst...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:35:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.