Class used as member for DDX_Text data exchange.
More...
#include <ktext.h>
Class used as member for DDX_Text data exchange.
This class serves as a proxy on top of an existing Qt widget, with an API similar to the API of a CString in MFC, when used as the data member in DDX_Text data exchange routine. It currently supports QLabel, QLineEdit and QComboBox widgets.
- See also
- https://learn.microsoft.com/en-us/cpp/mfc/reference/standard-dialog-data-exchange-routines#ddx_text
◆ KText() [1/6]
◆ KText() [2/6]
KText::KText |
( |
const wchar_t * | text | ) |
|
|
explicit |
◆ KText() [3/6]
KText::KText |
( |
const char * | text | ) |
|
|
explicit |
◆ KText() [4/6]
KText::KText |
( |
QString | text | ) |
|
|
explicit |
◆ KText() [5/6]
KText::KText |
( |
const KText & | other | ) |
|
|
delete |
◆ ~KText()
The destructor will remove the QByteArray generated by a constData call.
◆ KText() [6/6]
KText::KText |
( |
const CString & | text | ) |
|
|
explicit |
◆ Compare()
int KText::Compare |
( |
const QString & | other | ) |
const |
Compares two strings (case-sensitive).
◆ constData()
const char * KText::constData |
( |
| ) |
const |
Converts to a const char * implicitly.
This method is used mainly for compatibility for old API or code. This method creates and store a QByteArray internally, to be avoided if possible
- Deprecated
- Use explicit conversion methods
◆ Format()
template<typename T , typename... Ts>
KText & KText::Format |
( |
T && | format, |
|
|
Ts... | args ) |
|
inline |
Writes formatted data to the widget in the same way that sprintf_s formats data into a C-style character array.
◆ operator CString()
KText::operator CString |
( |
| ) |
const |
◆ operator QString()
KText::operator QString |
( |
| ) |
const |
◆ operator std::string()
KText::operator std::string |
( |
| ) |
const |
◆ operator std::wstring()
KText::operator std::wstring |
( |
| ) |
const |
◆ operator=() [1/5]
KText & KText::operator= |
( |
const char * | text | ) |
|
◆ operator=() [2/5]
KText & KText::operator= |
( |
const CString & | text | ) |
|
◆ operator=() [3/5]
◆ operator=() [4/5]
KText & KText::operator= |
( |
const QString & | text | ) |
|
◆ operator=() [5/5]
KText & KText::operator= |
( |
const wchar_t * | text | ) |
|
◆ setValidator()
void KText::setValidator |
( |
QValidator * | validator | ) |
|
Sets a validator to the widget associated with this KText.
◆ setWidget()
void KText::setWidget |
( |
QWidget * | label | ) |
|
Sets the widget associated with this KText.
This method is usually called in the DoDataExchange method during the migration. Only the constructor is allowed before calling this method.
- Parameters
-
label | Widget used, only QLabel, QLineEdit and QComboBox are supported |
◆ toCString()
CString KText::toCString |
( |
| ) |
const |
◆ toQString()
QString KText::toQString |
( |
| ) |
const |
◆ toStdString()
std::string KText::toStdString |
( |
| ) |
const |
◆ toStdWString()
std::wstring KText::toStdWString |
( |
| ) |
const |
◆ widget()
QWidget * KText::widget |
( |
| ) |
const |
Returns the widget associated with this KText.
The documentation for this class was generated from the following file: