CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
CFxUITextEdit Class Reference

#include <FxUITextEdit.h>

Inheritance diagram for CFxUITextEdit:
CFxUIBaseView CFxUIObject

Public Types

enum  EchoMode { eNormal = 0 , ePassword = 1 }
 
- Public Types inherited from CFxUIBaseView
enum  TextAlignment {
  AlignLeft = 0x0001 , AlignRight = 0x0002 , AlignHCenter = 0x0004 , AlignJustify = 0x0008 ,
  AlignTop = 0x0020 , AlignBottom = 0x0040 , AlignVCenter = 0x0080 , AlignBaseline = 0x0100 ,
  AlignCenter = AlignVCenter | AlignHCenter
}
 
enum  FocusPolicyType {
  eNoFocus = 0 , eTabFocus = 0x1 , eClickFocus = 0x2 , eStrongFocus = eTabFocus | eClickFocus | 0x8 ,
  eWheelFocus = eStrongFocus | 0x4 , eKeyboardOnSetfocus = 0x10
}
 
enum  UIWidthSizePolicy {
  eExpanding = -1 , eXS = 0 , eS , eM ,
  eL , eXL
}
 

Public Member Functions

 CFxUITextEdit (UIWidthSizePolicy width=eM)
 
 ~CFxUITextEdit ()
 
void setText (const CFxUIString &str)
 
CFxUIString text () const
 
void setPlainText (const CFxUIString &sText)
 
CFxUIString toPlainText () const
 
void setPlaceholderText (const CFxUIString &str)
 
CFxUIString placeholderText () const
 
void setClearButtonEnabled (bool bEnable)
 
bool isClearButtonEnabled () const
 
void selectAll ()
 
void setFocus ()
 
void moveCursor (QTextCursor::MoveOperation operation, QTextCursor::MoveMode mode=QTextCursor::MoveAnchor)
 
void setInputType (int type)
 
void setInputMask (const CFxUIString &str)
 
CFxUIString inputMask () const
 
void setReadOnly (bool readOnly)
 
void clear ()
 
void setTextAlignment (TextAlignment iAlignment)
 
void setEchoMode (EchoMode echoMode)
 
CFxUISignal< void(const QString)> & textChanged ()
 
CFxUISignal< void(void)> & editingFinished ()
 
CFxUISignal< void(const QString)> & textEdited ()
 
CFxUISignal< void(int, int)> & keyPressed ()
 
- Public Member Functions inherited from CFxUIBaseView
 CFxUIBaseView ()
 
virtual ~CFxUIBaseView ()
 
void setDisabled (bool on)
 
void setEnabled (bool on)
 
bool isEnabled () const
 
CFxUIPalette::ColorRole backgroundRole ()
 
void setPalette (const CFxUIPalette &)
 
const CFxUIPalettepalette () const
 
bool isVisible ()
 
void setVisible (bool bVisible)
 
bool hasFocus () const
 
void setFocus ()
 
void setFocus (int iReason)
 
void setFocusPolicy (int iPolicy)
 
int width ()
 
void setWidth (int w)
 
int height ()
 
void setHeight (int h)
 
void update ()
 
void setBusyState (bool bBusy=false)
 
void resize (int w, int h)
 
void setCornerRadius (float radius)
 
void setBorderWidth (float width)
 
void setBorderWidth (float left, float top, float right, float bottom)
 
void setBorderColor (int r, int g, int b)
 
virtual void showEvent (CFxUIShowEvent *event)
 
virtual void hideEvent (CFxUIHideEvent *event)
 
virtual void paintEvent (CFxUIPaintEvent *event)
 
virtual void resizeEvent (CFxUIResizeEvent *event)
 
virtual void focusInEvent (CFxUIFocusEvent *focusInEvent)
 
virtual void focusOutEvent (CFxUIFocusEvent *focusOutEvent)
 
void setEventAccepted (bool bAccepted=false)
 
void addView (CFxUIBaseView *pChild, float fWeight=0.0)
 
void insertView (CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
 
int indexOf (CFxUIBaseView *pChild)
 
void removeView (CFxUIBaseView *pChild)
 
void setPreferableSize (int w, int h)
 
void setMinimumWidth (int iWidth)
 
void setMinimumHeight (int iHeight)
 
void setMinimumSize (const CFxUISize &size)
 
void setMaximumWidth (int iWidth)
 
void setMaximumHeight (int iHeight)
 
void setMaximumSize (const CFxUISize &size)
 
int minimumWidth ()
 
int minimumHeight ()
 
int maximumWidth ()
 
int maximumHeight ()
 
void setToolTip (const CFxUIString &sToolTip)
 
const CFxUIString toolTip ()
 
CFxUISignal< void(void)> & aboutToPassEventToParent ()
 
CFxUISignal< void(void)> & aboutToShow ()
 
CFxUISignal< void(void)> & hoverEnter ()
 
CFxUISignal< void(void)> & hoverLeave ()
 
CFxUISignal< void(bool)> & visibilityChanged ()
 
- Public Member Functions inherited from CFxUIObject
 CFxUIObject ()
 
virtual ~CFxUIObject ()
 
FxNativeHandle getHandle () const
 
void setHandle (FxNativeHandle handle)
 
void setParent (CFxUIObject *parent)
 
CFxUIObjectparent ()
 
const CFxUIObjectparent () const
 
void setObjectName (const CFxUIString &objectName)
 
CFxUIString objectName () const
 
bool setProperty (const char *name, const CFxUIVariant &value)
 
CFxUIVariant property (const char *name)
 
CFxUIList< CFxUIObject * > children () const
 
template<typename T >
CFxUIList< T > findChildren (const CFxUIString &name=CFxUIString())
 
void blockSignals (bool block)
 
bool signalsBlocked () const
 

Additional Inherited Members

- Static Public Member Functions inherited from CFxUIBaseView
static void setTabOrder (CFxUIObject *first, CFxUIObject *second)
 
- Protected Member Functions inherited from CFxUIObject
CFxUIObjectsender ()
 
- Protected Attributes inherited from CFxUIObject
CFxUIObjectImpl * m_pImpl
 
CFxUIObjectData * m_pData
 

Detailed Description

Class CFxUITextEdit is a one-line text editor.

Definition at line 28 of file FxUITextEdit.h.

Member Enumeration Documentation

◆ EchoMode

This enum type describes how a line edit should display its contents.

Enumerator
eNormal 
ePassword 

Definition at line 34 of file FxUITextEdit.h.

Constructor & Destructor Documentation

◆ CFxUITextEdit()

CFxUITextEdit::CFxUITextEdit ( UIWidthSizePolicy  width = eM)
explicit

Constructor

Parameters
widthInput .Default vale for width is eM i.e. medium

◆ ~CFxUITextEdit()

CFxUITextEdit::~CFxUITextEdit ( )

Destructor

Member Function Documentation

◆ clear()

void CFxUITextEdit::clear ( )

Clears the content of text editor.

◆ editingFinished()

CFxUISignal< void(void)> & CFxUITextEdit::editingFinished ( )

Signal is emitted whenever the editing is finished i.e. when focusOut event occurs.

◆ inputMask()

CFxUIString CFxUITextEdit::inputMask ( ) const

Return the validation mask of text edit.

If no mask is set, inputMask() returns an empty string.

Returns
string.

◆ isClearButtonEnabled()

bool CFxUITextEdit::isClearButtonEnabled ( ) const

Return if clear button is enabled in text edit.

Returns
bool This returns true if clear button is enabled, else false

◆ keyPressed()

CFxUISignal< void(int, int)> & CFxUITextEdit::keyPressed ( )

Signal is emitted whenever a key is pressed.

◆ moveCursor()

void CFxUITextEdit::moveCursor ( QTextCursor::MoveOperation  operation,
QTextCursor::MoveMode  mode = QTextCursor::MoveAnchor 
)

Moves the cursor by performing the given operation.

Parameters
operationIt indicates to move the cursor as per enum defined for QTextCursor::MoveOperation.
modeIt indicates to move the anchor as per enum defined for QTextCursor::MoveMode.

◆ placeholderText()

CFxUIString CFxUITextEdit::placeholderText ( ) const

Return the placeholder text.

Returns
string

◆ selectAll()

void CFxUITextEdit::selectAll ( )

Selects all the text (i.e. highlights it)

◆ setClearButtonEnabled()

void CFxUITextEdit::setClearButtonEnabled ( bool  bEnable)

Sets clear button enabled

The text edit displays a clear button when it is not empty.

Parameters
bEnableThe clear button is visible when parameter is true, otherwise hidden.

◆ setEchoMode()

void CFxUITextEdit::setEchoMode ( EchoMode  echoMode)

Sets the line edit's echo mode.

The echo mode determines how the text entered in the line edit is displayed (or echoed) to the user.

By default, the echoMode is set to eNormal. The possible echoModes are eNormal and ePassword.

◆ setFocus()

void CFxUITextEdit::setFocus ( )

Sets the focus to text edit.

Cursor is set to the text edit.

◆ setInputMask()

void CFxUITextEdit::setInputMask ( const CFxUIString str)

Sets the validation mask for text edit.

Parameters
strInput. The input string consists of a string of mask characters and separators, optionally followed by a semicolon and the character used for blanks.

◆ setInputType()

void CFxUITextEdit::setInputType ( int  type)

Sets the input type of text edit.

Parameters
typeInput.

◆ setPlaceholderText()

void CFxUITextEdit::setPlaceholderText ( const CFxUIString str)

Sets the placeholder text.

This setting display a grayed-out placeholder text as long as the text() is empty and the widget doesn't have focus.

Parameters
strInput

◆ setPlainText()

void CFxUITextEdit::setPlainText ( const CFxUIString sText)

Sets the text editor's contents as plain text.

Parameters
sTextInput.

◆ setReadOnly()

void CFxUITextEdit::setReadOnly ( bool  readOnly)

Sets the content of text edit to read-only mode.

In read-only mode, the user can still copy the text to the clipboard, or drag and drop the text (if echoMode() is Normal), but cannot edit it.

Parameters
readOnlyThe content is read only if parameter passed is true.

◆ setText()

void CFxUITextEdit::setText ( const CFxUIString str)

Sets the text in text editor.

Parameters
strInput

◆ setTextAlignment()

void CFxUITextEdit::setTextAlignment ( TextAlignment  iAlignment)

Sets alignment of text.

Parameters
iAlignmentThe value is to be from enums defined in TextAlignment.

◆ text()

CFxUIString CFxUITextEdit::text ( ) const

Returns the text.

Returns
string

◆ textChanged()

CFxUISignal< void(const QString)> & CFxUITextEdit::textChanged ( )

Signal is emitted whenever the content of text edit is changed.

◆ textEdited()

CFxUISignal< void(const QString)> & CFxUITextEdit::textEdited ( )

Signal is emitted whenever the text is edited. The text argument is the new text.

Unlike textChanged(), this signal is not emitted when the text is changed programmatically, for example, by calling setText().

◆ toPlainText()

CFxUIString CFxUITextEdit::toPlainText ( ) const

Returns the text editor's content as plain text.

If the text editor has another content type, it will not be replaced by plain text if you call toPlainText().

Returns
string

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