Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
KImageList Class Reference

The KImageList class defines a list of images, each of the same size. More...

#include <kimagelist.h>

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

Public Types

enum class  CreationFlag : uint {
  Mask = 0x00000001 , Color = 0x00000002 , ColorDDB = 0x00000004 , Color4 = 0x00000008 ,
  Color8 = 0x00000010 , Color16 = 0x00000020 , Color24 = 0x00000040 , Color32 = 0x00000080 ,
  Palette = 0x00000100 , Mirror = 0x00000200 , PerItemMirror = 0x00000400 , OriginalSize = 0x00000800 ,
  HighQualityScale = 0x00001000
}
 

Public Member Functions

int Add (QImage images, const QColor &mask={})
 Adds an image or images to an image list.
 
int Create (int cx, int cy, CreationFlags flags, int cInitial, int cGrow)
 Initializes an image list.
 
int Create (int cx, int cy, int nInitial)
 Initializes an image list.
 
 KImageList ()
 
 KImageList (const QImage &images, int cx=-1)
 Construct a new KImageList object from an image.
 
 Q_DECLARE_FLAGS (CreationFlags, CreationFlag)
 

Detailed Description

The KImageList class defines a list of images, each of the same size.

This class can replace a CImageList with the same API, and be used with KListModel.

See also
https://learn.microsoft.com/en-us/cpp/mfc/reference/cimagelist-class

Member Enumeration Documentation

◆ CreationFlag

enum class KImageList::CreationFlag : uint
strong
Enumerator
Mask 
Color 
ColorDDB 
Color4 
Color8 
Color16 
Color24 
Color32 
Palette 
Mirror 
PerItemMirror 
OriginalSize 
HighQualityScale 

Constructor & Destructor Documentation

◆ KImageList() [1/2]

KImageList::KImageList ( )

◆ KImageList() [2/2]

KImageList::KImageList ( const QImage & images,
int cx = -1 )

Construct a new KImageList object from an image.

Parameters
cxwidth of each image, in pixels

The number of images will be inferred either by cx or from the height of the image if -1.

Member Function Documentation

◆ Add()

int KImageList::Add ( QImage images,
const QColor & mask = {} )

Adds an image or images to an image list.

Parameters
imagesbitmap containing the image or images, the number of images is inferred from the width of the bitmap
maskcolor used to generate the mask (unused for now)
Returns
Zero-based index of the first new image if successful; otherwise - 1
Note
The mask color is not used for now, the images are assumed to be cleaned up and semi-transparent

◆ Create() [1/2]

int KImageList::Create ( int cx,
int cy,
CreationFlags flags,
int cInitial,
int cGrow )

Initializes an image list.

Overloaded version of Create that matches the MFC API. Note that some parameters are unused

Parameters
cxwidth of each image, in pixels
cyheight of each image, in pixels
flagsunused
cInitialnumber of images reserved in the lis
cGrowunused
Returns
Nonzero if successful; otherwise 0.

◆ Create() [2/2]

int KImageList::Create ( int cx,
int cy,
int nInitial )

Initializes an image list.

Parameters
cxwidth of each image, in pixels
cyheight of each image, in pixels
cInitialnumber of images reserved in the list
Returns
Nonzero if successful; otherwise 0.

◆ Q_DECLARE_FLAGS()

KImageList::Q_DECLARE_FLAGS ( CreationFlags ,
CreationFlag  )

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