Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
kheaderctrl.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
23#include "../corelib/kstring.h"
25
26#include <QImage>
27#include <QObject>
28
29class QHeaderView;
30
32
33class KListModel;
34class KRect;
35
44class KDWINUTILS_EXPORT KHeaderCtrl : public QObject
45{
46 Q_OBJECT
47public:
48 KHeaderCtrl(QObject *parent = nullptr);
49
53 void setWidget(KListModel *widget);
54
55 enum class Mask : uint {
56 Width = 0x0001,
57 Height = Width,
58 Text = 0x0002,
59 Format = 0x0004,
60 LPARAM = 0x0008,
61 Bitmap = 0x0010,
62 Image = 0x0020,
63 DI_SetItem = 0x0040,
64 Order = 0x0080,
65 Filter = 0x0100,
66 State = 0x0200,
67 };
69
71 {
72 Masks mask;
73 int cxy;
75 QImage hbm;
77 int fmt;
78 void *lParam;
79 int iImage;
80 int iOrder;
81 int type;
82 void *pvFilter;
83 int state;
84 };
85
87 int GetItemCount() const;
88
90 bool GetItem(int nPos, HeaderItem *pHeaderItem) const;
92 void GetWindowRect(KRect *r) const;
93
94private:
95 KListModel *m_widget = nullptr;
96};
97
99
The KHeaderCtrl class is used to replace CHeaderCtrl.
Definition kheaderctrl.h:45
Mask
Definition kheaderctrl.h:55
int GetItemCount() const
Retrieves a count of the items in a header control.
void setWidget(KListModel *widget)
bool GetItem(int nPos, HeaderItem *pHeaderItem) const
Retrieves information about an item in a header control.
KHeaderCtrl(QObject *parent=nullptr)
void GetWindowRect(KRect *r) const
Gets the screen coordinates of CWnd.
KListModel * widget() const
Q_DECLARE_FLAGS(Masks, Mask)
The KListModel class is used to replace DDX_Control edit data exchange.
Definition klistmodel.h:66
The KRect class defines a rectangle in the plane using integer precision.
Definition krect.h:40
The KString class provides a Unicode character string.
Definition kstring.h:45
#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)
Definition kheaderctrl.h:71
int state
The state of the item.
Definition kheaderctrl.h:83
int iOrder
The order in which the item appears within the header control, from left to right.
Definition kheaderctrl.h:80
Masks mask
Specifies which members of the structure are valid input.
Definition kheaderctrl.h:72
QImage hbm
The item's bitmap.
Definition kheaderctrl.h:75
int iImage
The zero-based index of an image within the image list.
Definition kheaderctrl.h:79
int type
The type of filter specified by pvFilter.
Definition kheaderctrl.h:81
int fmt
Flags that specify the item's format.
Definition kheaderctrl.h:77
void * pvFilter
The address of an application-defined data item.
Definition kheaderctrl.h:82
int cchTextMax
The length of the item string.
Definition kheaderctrl.h:76
void * lParam
Application-defined item data.
Definition kheaderctrl.h:78
KString pszText
The item's text.
Definition kheaderctrl.h:74
int cxy
The width or height of the item.
Definition kheaderctrl.h:73