Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
kcombobox.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
23#include "../corelib/kstring.h"
25
26#include <QByteArray>
27
28class QComboBox;
29
31
41{
42public:
45 explicit KComboBox(int value);
46
48 QComboBox *widget() const;
50 void setWidget(QComboBox *combobox);
51
53 operator KString() const;
54
56 KComboBox &operator=(int value);
57
59 operator int() const;
60
62 int GetCount() const;
64 int GetCurSel() const;
66 int SetCurSel(int nSelect);
67
69 int AddString(const KString &lpszString);
71 int DeleteString(int nIndex);
72
74 void Clear();
77
79 int InsertString(int nIndex, KString lpszString);
80
82 int GetLBTextLen(int nIndex) const;
83
84private:
85 int m_value = -1;
86 QComboBox *m_widget = nullptr;
87};
88
The KComboBox class is used to replace DDX_Control combobox data exchange.
Definition kcombobox.h:41
int DeleteString(int nIndex)
Deletes a string from the list box of a combo box.
KComboBox & operator=(int value)
int InsertString(int nIndex, KString lpszString)
Inserts a string into the list box of a combo box.
int SetCurSel(int nSelect)
Selects a string in the list box of a combo box.
int GetLBTextLen(int nIndex) const
Gets the length of a string in the list box of a combo box.
int AddString(const KString &lpszString)
Adds a string to the end of the list in the list box of a combo box.
int GetCurSel() const
Retrieves the index of the currently selected item, if any, in the list box of a combo box.
void ResetContent()
Removes all items from the list box and edit control of a combo box.
int GetCount() const
Retrieves the number of items in the list box of a combo box.
KComboBox(int value)
void Clear()
Deletes (clears) the current selection, if any, in the edit control.
void setWidget(QComboBox *combobox)
QComboBox * widget() const
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