Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
kimagelist.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** This file is part of KDWinutils, KDAB's MFC to Qt migration tool.
4**
5** Copyright (C) 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6** All rights reserved.
7**
8** This file is intended solely for use by the migration tools and services
9** provided by Klarälvdalens Datakonsult AB.
10**
11** Any other use or distribution of this software that is not otherwise agreed
12** upon in writing and signed by an authorized representative of Klarälvdalens
13** Datakonsult AB, KDAB (USA) LLC, KDAB (Deutschland) GmbH & Co. K.G.,
14** KDAB (France) SAS, KDAB (UK), Ltd., or any future subsidiary of Klarälvdalens
15** Datakonsult AB is hereby prohibited.
16**
17** Contact info@kdab.com if any conditions stated above are unclear to you.
18**
19****************************************************************************/
20
21#pragma once
22
24
25#include <QImage>
26#include <QVector>
27
29
37class KDWINUTILS_EXPORT KImageList : public QList<QImage>
38{
39public:
48 KImageList(const QImage &images, int cx = -1);
49
50 enum class CreationFlag : uint {
51 Mask = 0x00000001,
52 Color = 0x00000002,
53 ColorDDB = 0x00000004,
54 Color4 = 0x00000008,
55 Color8 = 0x00000010,
56 Color16 = 0x00000020,
57 Color24 = 0x00000040,
58 Color32 = 0x00000080,
59 Palette = 0x00000100,
60 Mirror = 0x00000200,
61 PerItemMirror = 0x00000400,
62 OriginalSize = 0x00000800,
63 HighQualityScale = 0x00001000,
64 };
66
75 int Create(int cx, int cy, int nInitial);
76
89 int Create(int cx, int cy, CreationFlags flags, int cInitial, int cGrow);
90
100 int Add(QImage images, const QColor &mask = {});
101
102private:
103 QSize m_iconSize;
104};
105
106Q_DECLARE_OPERATORS_FOR_FLAGS(KImageList::CreationFlags)
107
The KImageList class defines a list of images, each of the same size.
Definition kimagelist.h:38
int Create(int cx, int cy, int nInitial)
Initializes an image list.
CreationFlag
Definition kimagelist.h:50
int Create(int cx, int cy, CreationFlags flags, int cInitial, int cGrow)
Initializes an image list.
Q_DECLARE_FLAGS(CreationFlags, CreationFlag)
int Add(QImage images, const QColor &mask={})
Adds an image or images to an image list.
KImageList(const QImage &images, int cx=-1)
Construct a new KImageList object from an image.
#define KDWINUTILS_EXPORT
Definition kdwinutils_export.h:31
#define KDWINUTILS_BEGIN_NAMESPACE
Definition kdwinutils_global.h:27
#define KDWINUTILS_END_NAMESPACE
Definition kdwinutils_global.h:28
Q_DECLARE_OPERATORS_FOR_FLAGS(KHeaderCtrl::Masks)