Logo    
KDWinUtils
Helper library for MFC to Qt migration
Loading...
Searching...
No Matches
KEdit Class Reference

The KEdit class is used to replace DDX_Control edit data exchange. More...

#include <kedit.h>

Public Member Functions

bool CanUndo () const
 Call this function to determine if the last edit operation can be undone.
 
void Clear ()
 Call this function to delete (clear) the current selection (if any) in the edit control.
 
void Copy ()
 Call this function to copy the current selection.
 
void Cut ()
 Call this function to delete (cut) the current selection.
 
uint GetLimitText () const
 Call this member function to get the text limit for this KEdit object.
 
bool GetModify () const
 Call this function to determine whether the contents of an edit control have been modified.
 
int GetSel () const
 Gets the first character position of the current selection in an edit control.
 
void GetSel (int &nStartChar, int &nEndChar) const
 Gets the first and last character positions of the current selection in an edit control.
 
void GetWindowText (KString &str) const
 Get the text of the line edit.
 
 operator KString () const
 
void Paste ()
 Call this function to insert the data from the Clipboard into the KEdit at the insertion point.
 
void SetLimitText (unsigned int nMax)
 Sets the maximum amount of text this KEdit can contain.
 
void SetModify (bool bModified=true)
 Call this function to set or clear the modified flag for an edit control.
 
void SetReadOnly (bool bReadOnly=true)
 Calls this function to set the read-only state of an edit control.
 
void SetSel (int nStartChar, int nEndChar=-1)
 Selects a range of characters in an edit control [start, end[.
 
void setWidget (QLineEdit *lineEdit)
 
void SetWindowText (const KString &str)
 Change the text of the line edit.
 
QLineEdit * widget () const
 

Detailed Description

The KEdit class is used to replace DDX_Control edit data exchange.

This class is the equivalent of CEdit in MFC. It is a proxy for the widget, and can be used to set and get the value. It can only support single line edit (QLineEdit).

See also
https://learn.microsoft.com/en-us/cpp/mfc/reference/cedit-class

Member Function Documentation

◆ CanUndo()

bool KEdit::CanUndo ( ) const

Call this function to determine if the last edit operation can be undone.

◆ Clear()

void KEdit::Clear ( )

Call this function to delete (clear) the current selection (if any) in the edit control.

◆ Copy()

void KEdit::Copy ( )

Call this function to copy the current selection.

◆ Cut()

void KEdit::Cut ( )

Call this function to delete (cut) the current selection.

◆ GetLimitText()

uint KEdit::GetLimitText ( ) const

Call this member function to get the text limit for this KEdit object.

◆ GetModify()

bool KEdit::GetModify ( ) const

Call this function to determine whether the contents of an edit control have been modified.

◆ GetSel() [1/2]

int KEdit::GetSel ( ) const

Gets the first character position of the current selection in an edit control.

◆ GetSel() [2/2]

void KEdit::GetSel ( int & nStartChar,
int & nEndChar ) const

Gets the first and last character positions of the current selection in an edit control.

◆ GetWindowText()

void KEdit::GetWindowText ( KString & str) const

Get the text of the line edit.

◆ operator KString()

KEdit::operator KString ( ) const

Returns the string of the line edit.

◆ Paste()

void KEdit::Paste ( )

Call this function to insert the data from the Clipboard into the KEdit at the insertion point.

◆ SetLimitText()

void KEdit::SetLimitText ( unsigned int nMax)

Sets the maximum amount of text this KEdit can contain.

◆ SetModify()

void KEdit::SetModify ( bool bModified = true)

Call this function to set or clear the modified flag for an edit control.

◆ SetReadOnly()

void KEdit::SetReadOnly ( bool bReadOnly = true)

Calls this function to set the read-only state of an edit control.

◆ SetSel()

void KEdit::SetSel ( int nStartChar,
int nEndChar = -1 )

Selects a range of characters in an edit control [start, end[.

If the parameters are (0, -1), all the text is selected. If the second parameter is -1, any current selection is removed.

◆ setWidget()

void KEdit::setWidget ( QLineEdit * lineEdit)

Sets the widget the class is proxying.

◆ SetWindowText()

void KEdit::SetWindowText ( const KString & str)

Change the text of the line edit.

◆ widget()

QLineEdit * KEdit::widget ( ) const

Returns the underlying widget the class is proxying.


The documentation for this class was generated from the following file: