12#include <kis_action.h>
13#include <KisMainWindow.h>
15#include <KisDocument.h>
16#include <KisViewManager.h>
17#include <kis_action_manager.h>
24struct Window::Private {
30Window::Window(KisMainWindow *window,
QObject *parent)
35 connect(window, SIGNAL(destroyed(
QObject*)), SIGNAL(windowClosed()));
36 connect(window, SIGNAL(themeChanged()), SIGNAL(themeChanged()));
37 connect(window, SIGNAL(activeViewChanged()), SIGNAL(activeViewChanged()));
45bool Window::operator==(
const Window &other)
const
47 return (d->window == other.d->window);
50bool 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);
The Document class encapsulates a Krita Document/Image.
View represents one view on a document.
Window represents one Krita mainwindow.
void close()
close the active window and all its Views.
View * activeView() const
QList< QDockWidget * > dockers() const
dockers
QList< View * > views() const
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.
void showView(View *view)
Make the given view active in this window.
QMainWindow * qwindow() const
Return a handle to the QMainWindow widget.
void activate()
activate activates this Window.
View * addView(Document *document)
Open a new view on the given document in this window.
bool isEmpty() const const
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)