digiKam
Digikam::SinglePhotoPreviewLayout Class Reference
+ Inheritance diagram for Digikam::SinglePhotoPreviewLayout:

Public Types

enum  SetZoomFlag { JustSetFactor = 0 , CenterView = 1 << 0 , SnapZoomFactor = 1 << 1 }
 

Public Slots

void decreaseZoom (const QPoint &viewportAnchor=QPoint())
 
void fitToWindow ()
 
void increaseZoom (const QPoint &viewportAnchor=QPoint())
 
void setZoomFactor (double z, const QPoint &viewportAnchor=QPoint(), SetZoomFlags flags=JustSetFactor)
 
void setZoomFactor (double z, SetZoomFlags flags)
 
void setZoomFactorSnapped (double z)
 
void toggleFitToWindow ()
 Toggle between fitToWindow and previous zoom factor. More...
 
void toggleFitToWindowOr100 ()
 Toggle between fitToWindow and zoom factor 1. More...
 
void updateZoomAndSize ()
 Update settings when size of image or view changed. More...
 

Signals

void fitToWindowToggled (bool fitToWindow)
 
void zoomFactorChanged (double)
 

Public Member Functions

void addItem (GraphicsDImgItem *const item)
 
bool atMaxZoom () const
 
bool atMinZoom () const
 
bool isFitToWindow () const
 
double maxZoomFactor () const
 
double minZoomFactor () const
 
double realZoomFactor () const
 
void setGraphicsView (GraphicsDImgView *const view)
 
void setMaxZoomFactor (double z)
 
void setMinZoomFactor (double z)
 
 SinglePhotoPreviewLayout (QObject *const parent)
 
double zoomFactor () const
 
 ~SinglePhotoPreviewLayout () override
 

Protected Member Functions

void updateLayout ()
 

Member Enumeration Documentation

◆ SetZoomFlag

Enumerator
JustSetFactor 
CenterView 
SnapZoomFactor 

Constructor & Destructor Documentation

◆ SinglePhotoPreviewLayout()

Digikam::SinglePhotoPreviewLayout::SinglePhotoPreviewLayout ( QObject *const  parent)
explicit

◆ ~SinglePhotoPreviewLayout()

Digikam::SinglePhotoPreviewLayout::~SinglePhotoPreviewLayout ( )
override

Member Function Documentation

◆ addItem()

void Digikam::SinglePhotoPreviewLayout::addItem ( GraphicsDImgItem *const  item)

Set the item to layout. For a SinglePhoto layout, typically, you can add only one item.

References updateZoomAndSize().

◆ atMaxZoom()

bool Digikam::SinglePhotoPreviewLayout::atMaxZoom ( ) const

References zoomFactor().

◆ atMinZoom()

bool Digikam::SinglePhotoPreviewLayout::atMinZoom ( ) const

References zoomFactor().

◆ decreaseZoom

void Digikam::SinglePhotoPreviewLayout::decreaseZoom ( const QPoint &  viewportAnchor = QPoint())
slot

◆ fitToWindow

◆ fitToWindowToggled

void Digikam::SinglePhotoPreviewLayout::fitToWindowToggled ( bool  fitToWindow)
signal

Referenced by fitToWindow(), and setZoomFactor().

◆ increaseZoom

void Digikam::SinglePhotoPreviewLayout::increaseZoom ( const QPoint &  viewportAnchor = QPoint())
slot

◆ isFitToWindow()

bool Digikam::SinglePhotoPreviewLayout::isFitToWindow ( ) const

◆ maxZoomFactor()

double Digikam::SinglePhotoPreviewLayout::maxZoomFactor ( ) const

The zoom range for incrementing and decrementing.

Referenced by setZoomFactor(), and Digikam::EditorStackView::zoomMax().

◆ minZoomFactor()

double Digikam::SinglePhotoPreviewLayout::minZoomFactor ( ) const

◆ realZoomFactor()

double Digikam::SinglePhotoPreviewLayout::realZoomFactor ( ) const

◆ setGraphicsView()

void Digikam::SinglePhotoPreviewLayout::setGraphicsView ( GraphicsDImgView *const  view)

Set the graphics view, and associated scene, to operate on.

◆ setMaxZoomFactor()

void Digikam::SinglePhotoPreviewLayout::setMaxZoomFactor ( double  z)

Referenced by setZoomFactor(), and updateZoomAndSize().

◆ setMinZoomFactor()

void Digikam::SinglePhotoPreviewLayout::setMinZoomFactor ( double  z)

Referenced by setZoomFactor(), and updateZoomAndSize().

◆ setZoomFactor [1/2]

◆ setZoomFactor [2/2]

void Digikam::SinglePhotoPreviewLayout::setZoomFactor ( double  z,
SetZoomFlags  flags 
)
slot

References setZoomFactor().

◆ setZoomFactorSnapped

void Digikam::SinglePhotoPreviewLayout::setZoomFactorSnapped ( double  z)
slot

◆ toggleFitToWindow

void Digikam::SinglePhotoPreviewLayout::toggleFitToWindow ( )
slot

Toggle between fitToWindow and previous zoom factor.

References fitToWindow(), and setZoomFactor().

Referenced by Digikam::EditorStackView::toggleFitToWindow().

◆ toggleFitToWindowOr100

void Digikam::SinglePhotoPreviewLayout::toggleFitToWindowOr100 ( )
slot

Toggle between fitToWindow and zoom factor 1.

References fitToWindow(), setZoomFactor(), and zoomFactor().

Referenced by Digikam::EditorStackView::zoomTo100Percent().

◆ updateLayout()

void Digikam::SinglePhotoPreviewLayout::updateLayout ( )
protected

◆ updateZoomAndSize

void Digikam::SinglePhotoPreviewLayout::updateZoomAndSize ( )
slot

Update settings when size of image or view changed.

References fitToWindow(), Digikam::ImageZoomSettings::OnlyScaleDown, setMaxZoomFactor(), setMinZoomFactor(), and updateLayout().

Referenced by addItem().

◆ zoomFactor()

double Digikam::SinglePhotoPreviewLayout::zoomFactor ( ) const

◆ zoomFactorChanged

void Digikam::SinglePhotoPreviewLayout::zoomFactorChanged ( double  )
signal

Referenced by fitToWindow(), and setZoomFactor().


The documentation for this class was generated from the following files: