Krita Source Code Documentation
Loading...
Searching...
No Matches
View::Private Struct Reference

Public Member Functions

 Private ()
 
void reconnect (View *self)
 

Public Attributes

QPointer< KisCanvasResourceProviderresourceProvider
 
QPointer< KoToolProxytoolProxy
 
QPointer< KisViewview
 

Detailed Description

Definition at line 34 of file View.cpp.

Constructor & Destructor Documentation

◆ Private()

View::Private::Private ( )
inline

Definition at line 35 of file View.cpp.

35{}

Member Function Documentation

◆ reconnect()

void View::Private::reconnect ( View * self)
inline

Definition at line 40 of file View.cpp.

41 {
42 // View::setDocument() can replace the wrapped KisView.
43 if (toolProxy) {
44 QObject::disconnect(toolProxy, SIGNAL(toolChanged(QString)), self, SIGNAL(currentToolChanged(QString)));
45 toolProxy.clear();
46 }
47
48 if (resourceProvider) {
49 QObject::disconnect(resourceProvider, SIGNAL(sigPaintOpPresetChanged(KisPaintOpPresetSP)), self, SIGNAL(currentBrushPresetChanged()));
50 QObject::disconnect(resourceProvider, SIGNAL(sigFGColorChanged(KoColor)), self, SIGNAL(foregroundColorChanged()));
51 QObject::disconnect(resourceProvider, SIGNAL(sigBGColorChanged(KoColor)), self, SIGNAL(backgroundColorChanged()));
52 resourceProvider.clear();
53 }
54
55 if (!view) {
56 return;
57 }
58
59 resourceProvider = view->resourceProvider();
60 if (resourceProvider) {
61 QObject::connect(resourceProvider, SIGNAL(sigPaintOpPresetChanged(KisPaintOpPresetSP)), self, SIGNAL(currentBrushPresetChanged()));
62 QObject::connect(resourceProvider, SIGNAL(sigFGColorChanged(KoColor)), self, SIGNAL(foregroundColorChanged()));
63 QObject::connect(resourceProvider, SIGNAL(sigBGColorChanged(KoColor)), self, SIGNAL(backgroundColorChanged()));
64 }
65
66 KoCanvasBase *canvasBase = view->canvasBase();
67 if (!canvasBase) {
68 return;
69 }
70
71 toolProxy = canvasBase->toolProxy();
72 if (toolProxy) {
73 QObject::connect(toolProxy, SIGNAL(toolChanged(QString)), self, SIGNAL(currentToolChanged(QString)));
74 }
75 }
virtual KoToolProxy * toolProxy() const =0
void backgroundColorChanged()
void foregroundColorChanged()
void currentToolChanged(const QString &toolId)
void currentBrushPresetChanged()
QPointer< KoToolProxy > toolProxy
Definition View.cpp:37
QPointer< KisView > view
Definition View.cpp:36
QPointer< KisCanvasResourceProvider > resourceProvider
Definition View.cpp:38

References View::backgroundColorChanged(), View::currentBrushPresetChanged(), View::currentToolChanged(), View::foregroundColorChanged(), resourceProvider, KoCanvasBase::toolProxy(), toolProxy, and view.

Member Data Documentation

◆ resourceProvider

QPointer<KisCanvasResourceProvider> View::Private::resourceProvider

Definition at line 38 of file View.cpp.

◆ toolProxy

QPointer<KoToolProxy> View::Private::toolProxy

Definition at line 37 of file View.cpp.

◆ view

QPointer<KisView> View::Private::view

Definition at line 36 of file View.cpp.


The documentation for this struct was generated from the following file: