Krita

DockWidgetFactoryBase.h
1/*
2 * SPDX-FileCopyrightText: 2015 Cyrille Berger <cberger@cberger.net>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef LIBKIS_DOCKWIDGETFACTORY_H
8#define LIBKIS_DOCKWIDGETFACTORY_H
9
10#include <QString>
11#include <KoDockFactoryBase.h>
12
13#include "kritalibkis_export.h"
14
15/**
16 * @brief The DockWidgetFactoryBase class is the base class for plugins that want
17 * to add a dock widget to every window. You do not need to implement this class
18 * yourself, but create a DockWidget implementation and then add the DockWidgetFactory
19 * to the Krita instance like this:
20 *
21 * @code
22 * class HelloDocker(DockWidget):
23 * def __init__(self):
24 * super().__init__()
25 * label = QLabel("Hello", self)
26 * self.setWidget(label)
27 * self.label = label
28 *
29 * def canvasChanged(self, canvas):
30 * self.label.setText("Hellodocker: canvas changed");
31 *
32 * Application.addDockWidgetFactory(DockWidgetFactory("hello", DockWidgetFactoryBase.DockRight, HelloDocker))
33 *
34 * @endcode
35 */
36class KRITALIBKIS_EXPORT DockWidgetFactoryBase : public KoDockFactoryBase
37{
38public:
39 DockWidgetFactoryBase(const QString& _id, DockPosition _dockPosition);
40 ~DockWidgetFactoryBase() override;
41 QString id() const override;
42 DockPosition defaultDockPosition() const override;
43private:
44 QString m_id;
45 DockPosition m_dockPosition;
46};
47
48#endif
The DockWidgetFactoryBase class is the base class for plugins that want to add a dock widget to every...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:51:15 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.