Krita
12 #include <kis_action.h>
13 #include <KisMainWindow.h>
15 #include <KisDocument.h>
16 #include <KisViewManager.h>
17 #include <kis_action_manager.h>
18 #include <kis_debug.h>
24 struct Window::Private {
30 Window::Window(KisMainWindow *window,
QObject *parent)
36 connect(
window, SIGNAL(themeChanged()), SIGNAL(themeChanged()));
37 connect(
window, SIGNAL(activeViewChanged()), SIGNAL(activeViewChanged()));
45 bool Window::operator==(
const Window &other)
const
47 return (d->window == other.d->window);
50 bool Window::operator!=(
const Window &other)
const
52 return !(operator==(other));
62 KisMainWindow *mainWindow = d->window;
64 if (!mainWindow)
return {};
66 return mainWindow->dockWidgets();
74 if (view->mainWindow() == d->window) {
75 ret <<
new View(view);
85 if (d->window && document) {
89 document->setOwnsDocument(
false);
90 KisView *view = d->window->newView(document->document());
91 return new View(view);
98 if (
views().contains(view)) {
99 KisView *v = view->view();
100 d->window->showView(v);
107 return new View(d->window->activeView());
115 d->window->activateWindow();
122 KisPart::instance()->removeMainWindow(d->window);
130 KisAction *action = d->window->viewManager()->actionManager()->createAction(
id);
132 action->setText(text);
134 action->setObjectName(
id);
135 action->setProperty(
"menulocation", menuLocation);
QList< View * > views() const
Window represents one Krita mainwindow.
The Document class encapsulates a Krita Document/Image.
View represents one view on a document.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void destroyed(QObject *obj)
QMainWindow * qwindow() const
Return a handle to the QMainWindow widget.
QAction * createAction(const QString &id, const QString &text=QString(), const QString &menuLocation=QString("tools/scripts"))
createAction creates a QAction object and adds it to the action manager for this Window.
bool isEmpty() const const
View * addView(Document *document)
Open a new view on the given document in this window.
void showView(View *view)
Make the given view active in this window.
QList< QDockWidget * > dockers() const
dockers
void activate()
activate activates this Window.
View * activeView() const
void close()
close the active window and all its Views.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 03:58:42 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.