Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
kdwinwidgets_utils.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) 2023 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#ifdef KDWINUTILS_WITHMFC
26
27#include <QColor>
28#include <QImage>
29#include <QPen>
30#include <QPixmap>
31#include <QVector>
32
33#include <afxwin.h>
34
36
37namespace Utils {
38
40KDWINUTILS_EXPORT QColor toQColor(COLORREF rgb);
42KDWINUTILS_EXPORT QColor toQColor(COLORREF rgb, int alpha);
44KDWINUTILS_EXPORT COLORREF toCOLORREF(const QColor &color);
45
47KDWINUTILS_EXPORT QImage toQImage(HBITMAP bitmap);
49KDWINUTILS_EXPORT QImage toQImage(HICON icon);
50
52KDWINUTILS_EXPORT HBITMAP toHBITMAP(const QImage &image);
54KDWINUTILS_EXPORT HICON toHICON(const QImage &image);
55
57KDWINUTILS_EXPORT QList<QImage> toQImageList(CImageList *imageList);
58
60KDWINUTILS_EXPORT Qt::PenStyle toQtPenStyle(int value);
62KDWINUTILS_EXPORT Qt::PenCapStyle toQtPenCapStyle(int value);
64KDWINUTILS_EXPORT Qt::PenJoinStyle toQtPenJoinStyle(int value);
65
67KDWINUTILS_EXPORT Qt::BrushStyle toQtBrushStyle(int nIndex);
68
69} // namespace Utils
70
72
73#endif
#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
Definition kdwincore_utils.h:34
HBITMAP toHBITMAP(const QImage &image)
Converts a QImage to a HBITMAP.
Qt::PenCapStyle toQtPenCapStyle(int value)
Converts a CPen cap style to a Qt::PenCapStyle.
Qt::PenStyle toQtPenStyle(int value)
Converts a CPen style to a Qt::PenStyle.
QList< QImage > toQImageList(CImageList *imageList)
Converts a CImageList to a list of QImage.
QColor toQColor(COLORREF rgb)
Converts a COLORREF to a QColor.
Qt::PenJoinStyle toQtPenJoinStyle(int value)
Converts a CPen join style to a Qt::PenJoinStyle.
COLORREF toCOLORREF(const QColor &color)
Converts a QColor to a COLORREF.
Qt::BrushStyle toQtBrushStyle(int nIndex)
Converts a CBrush style to a Qt::BrushStyle.
QImage toQImage(HBITMAP bitmap)
Converts a HBITMAP to a QImage.
HICON toHICON(const QImage &image)
Converts a QImage to a HICON.