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

Public Member Functions

 Private (const Private &rhs)
 
 Private (KisImageWSP image)
 
void setImage (KisImageWSP image)
 
void slotImageResolutionChanged (qreal xRes, qreal yRes)
 
 ~Private ()
 

Public Attributes

KisImageWSP image
 
QMetaObject::Connection imageConnection
 
qreal lastKnownXRes
 
qreal lastKnownYRes
 

Detailed Description

Definition at line 28 of file KisImageResolutionProxy.cpp.

Constructor & Destructor Documentation

◆ Private() [1/2]

KisImageResolutionProxy::Private::Private ( KisImageWSP image)
inline

◆ Private() [2/2]

KisImageResolutionProxy::Private::Private ( const Private & rhs)
inline

Definition at line 36 of file KisImageResolutionProxy.cpp.

37 : lastKnownXRes(rhs.lastKnownXRes),
38 lastKnownYRes(rhs.lastKnownYRes)
39 {
40 setImage(rhs.image);
41 }

References image, and setImage().

◆ ~Private()

KisImageResolutionProxy::Private::~Private ( )
inline

Since we are not using QObject for the connection, we should disconnect the connection automatically on destruction.

Definition at line 43 of file KisImageResolutionProxy.cpp.

43 {
49 if (imageConnection) {
50 QObject::disconnect(imageConnection);
51 }
52 }

References imageConnection.

Member Function Documentation

◆ setImage()

void KisImageResolutionProxy::Private::setImage ( KisImageWSP image)

NOTE: we cannot just use detached converter all the time, because we cannot update its values in time before the next update after image changed its resolution (the signal is emitted at the very end of the operation).

The layer will keep "the lastly used resolution" until being attached to the new image.

Definition at line 123 of file KisImageResolutionProxy.cpp.

124{
125 QObject::disconnect(imageConnection);
126
127 if (image) {
136 this->image = image;
139
142 std::placeholders::_1, std::placeholders::_2));
143 } else {
148 this->image = nullptr;
149 }
150}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void sigResolutionChanged(double xRes, double yRes)
double xRes() const
double yRes() const
void slotImageResolutionChanged(qreal xRes, qreal yRes)

References connect(), KisWeakSharedPtr< T >::data(), KisImage::sigResolutionChanged(), slotImageResolutionChanged(), KisImage::xRes(), and KisImage::yRes().

◆ slotImageResolutionChanged()

void KisImageResolutionProxy::Private::slotImageResolutionChanged ( qreal xRes,
qreal yRes )

Member Data Documentation

◆ image

KisImageWSP KisImageResolutionProxy::Private::image

Definition at line 54 of file KisImageResolutionProxy.cpp.

◆ imageConnection

QMetaObject::Connection KisImageResolutionProxy::Private::imageConnection

Definition at line 57 of file KisImageResolutionProxy.cpp.

◆ lastKnownXRes

qreal KisImageResolutionProxy::Private::lastKnownXRes

Definition at line 55 of file KisImageResolutionProxy.cpp.

◆ lastKnownYRes

qreal KisImageResolutionProxy::Private::lastKnownYRes

Definition at line 56 of file KisImageResolutionProxy.cpp.


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