API Documentation
Loading...
Searching...
No Matches
ImageView Class Reference

#include <ImageView.h>

Inheritance diagram for ImageView:
[legend]
Collaboration diagram for ImageView:
[legend]

Public Types

enum  ViewMode { e_keep , e_zoom_in , e_zoom_out , e_stretch }
 

Public Member Functions

 ImageView (const String &image, QWidget *parent=nullptr)
 
 ImageView (QWidget *parent=nullptr)
 
 ~ImageView ()
 
void setImageID (const String &image, bool force_refresh=false)
 
void setIconID (const String &image, bool force_refresh=false)
 
void clearImage ()
 
void paintEvent (QPaintEvent *event) override
 
void setImage (const QPixmap &pixmap)
 
void setAlignment (Qt::Alignment alignment)
 
void setSizeHintPixelMetric (QStyle::PixelMetric metric)
 
void setSmoothResize (bool smooth_resize)
 
void setImage (const QImage &image)
 
void setIcon (const QIcon &image, QIcon::Mode mode=QIcon::Mode::Normal)
 
void setIconMode (QIcon::Mode mode)
 
QSize sizeHint () const override
 
QSize minimumSizeHint () const override
 
void setAutoResize (bool auto_resize)
 
void setViewMode (ViewMode mode)
 
void setBlendFactor (fltp04 blend_factor)
 
void setBlendImage (const QPixmap &blend_image)
 
void resizeEvent (QResizeEvent *resize_event) override
 
void setImageScale (fltp08 scale)
 
void setIgnoreDPR (bool ignore)
 
void setForceAspectRatioH (bool force)
 
void setForceAspectRatioW (bool force)
 
QIcon icon ()
 

Protected Member Functions

void setupIconListener ()
 
QRect alignRect (QSize size, QSize preferred_size) const
 

Protected Attributes

ViewMode m_view_mode = ViewMode::e_zoom_out
 
bool m_auto_resize = true
 
bool m_smooth_transform = true
 
bool m_force_aspect_ratio_width = false
 
bool m_force_aspect_ratio_height = false
 
bool m_ignore_device_pixel_ratio = false
 
fltp08 m_icon_scale
 
fltp04 m_blend_factor
 
QPixmap m_image
 
QPixmap m_blend_image
 
QIcon m_icon
 
String m_image_path
 
String m_icon_path
 
QIcon::Mode m_icon_mode
 
QStyle::PixelMetric m_size_hint_pixel_metric
 
Qt::Alignment m_alignment
 
QTResourceListenerm_theme_listener
 

Member Enumeration Documentation

◆ ViewMode

enum ViewMode
Enumerator
e_keep 
e_zoom_in 
e_zoom_out 
e_stretch 

Constructor & Destructor Documentation

◆ ImageView() [1/2]

ImageView ( const String & image,
QWidget * parent = nullptr )

◆ ImageView() [2/2]

ImageView ( QWidget * parent = nullptr)

◆ ~ImageView()

~ImageView ( )

Member Function Documentation

◆ alignRect()

QRect alignRect ( QSize size,
QSize preferred_size ) const
protected

◆ clearImage()

void clearImage ( )

◆ icon()

QIcon icon ( )
inline

◆ minimumSizeHint()

QSize minimumSizeHint ( ) const
inlineoverride

◆ paintEvent()

void paintEvent ( QPaintEvent * event)
override

◆ resizeEvent()

void resizeEvent ( QResizeEvent * resize_event)
override

◆ setAlignment()

void setAlignment ( Qt::Alignment alignment)

◆ setAutoResize()

void setAutoResize ( bool auto_resize)
inline

◆ setBlendFactor()

void setBlendFactor ( fltp04 blend_factor)

◆ setBlendImage()

void setBlendImage ( const QPixmap & blend_image)

◆ setForceAspectRatioH()

void setForceAspectRatioH ( bool force)

◆ setForceAspectRatioW()

void setForceAspectRatioW ( bool force)

◆ setIcon()

void setIcon ( const QIcon & image,
QIcon::Mode mode = QIcon::Mode::Normal )

◆ setIconID()

void setIconID ( const String & image,
bool force_refresh = false )

◆ setIconMode()

void setIconMode ( QIcon::Mode mode)

◆ setIgnoreDPR()

void setIgnoreDPR ( bool ignore)

◆ setImage() [1/2]

void setImage ( const QImage & image)

◆ setImage() [2/2]

void setImage ( const QPixmap & pixmap)

◆ setImageID()

void setImageID ( const String & image,
bool force_refresh = false )

◆ setImageScale()

void setImageScale ( fltp08 scale)
inline

◆ setSizeHintPixelMetric()

void setSizeHintPixelMetric ( QStyle::PixelMetric metric)

◆ setSmoothResize()

void setSmoothResize ( bool smooth_resize)
inline

◆ setupIconListener()

void setupIconListener ( )
protected

◆ setViewMode()

void setViewMode ( ViewMode mode)
inline

◆ sizeHint()

QSize sizeHint ( ) const
override

Member Data Documentation

◆ m_alignment

Qt::Alignment m_alignment
protected

◆ m_auto_resize

bool m_auto_resize = true
protected

◆ m_blend_factor

fltp04 m_blend_factor
protected

◆ m_blend_image

QPixmap m_blend_image
protected

◆ m_force_aspect_ratio_height

bool m_force_aspect_ratio_height = false
protected

◆ m_force_aspect_ratio_width

bool m_force_aspect_ratio_width = false
protected

◆ m_icon

QIcon m_icon
protected

◆ m_icon_mode

QIcon::Mode m_icon_mode
protected

◆ m_icon_path

String m_icon_path
protected

◆ m_icon_scale

fltp08 m_icon_scale
protected

◆ m_ignore_device_pixel_ratio

bool m_ignore_device_pixel_ratio = false
protected

◆ m_image

QPixmap m_image
protected

◆ m_image_path

String m_image_path
protected

◆ m_size_hint_pixel_metric

QStyle::PixelMetric m_size_hint_pixel_metric
protected

◆ m_smooth_transform

bool m_smooth_transform = true
protected

◆ m_theme_listener

QTResourceListener* m_theme_listener
protected

◆ m_view_mode

ViewMode m_view_mode = ViewMode::e_zoom_out
protected

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