libyui-qt  2.49.2
YQMultiLineEdit Class Reference

MultiLineEdit - an input area for multi-line text. More...

#include <YQMultiLineEdit.h>

Inheritance diagram for YQMultiLineEdit:
Collaboration diagram for YQMultiLineEdit:

Public Member Functions

 YQMultiLineEdit (YWidget *parent, const std::string &label)
 Constructor.
 
virtual ~YQMultiLineEdit ()
 Destructor.
 
virtual std::string value ()
 Get the current value (the text entered by the user or set from the outside) of this MultiLineEdit. More...
 
virtual void setValue (const std::string &text)
 Set the current value (the text entered by the user or set from the outside) of this MultiLineEdit. More...
 
virtual void setLabel (const std::string &label)
 Set the label (the caption above the MultiLineEdit). More...
 
virtual void setInputMaxLength (int numberOfChars)
 Set the maximum input length, i.e., the maximum number of characters the user can enter. More...
 
virtual void setEnabled (bool enabled)
 Set enabled/disabled state. More...
 
virtual int preferredWidth ()
 Preferred width of the widget. More...
 
virtual int preferredHeight ()
 Preferred height of the widget. More...
 
virtual void setSize (int newWidth, int newHeight)
 Set the new size of the widget. More...
 
virtual bool setKeyboardFocus ()
 Accept the keyboard focus.
 

Protected Slots

void changed ()
 Triggered when the text changes.
 
void enforceMaxInputLength ()
 Enforce the maximum input length: If the text becomes too long, remove the just-entered character at the current cursor position. More...
 

Protected Attributes

YQWidgetCaption_caption
 
QTextEdit * _qt_textEdit
 

Detailed Description

MultiLineEdit - an input area for multi-line text.

Definition at line 39 of file YQMultiLineEdit.h.

Member Function Documentation

◆ enforceMaxInputLength

void YQMultiLineEdit::enforceMaxInputLength ( )
protectedslot

Enforce the maximum input length: If the text becomes too long, remove the just-entered character at the current cursor position.

Note that this is a lot more user friendly than silently truncating at the end of the text: In the latter case, chances are that the user never gets to know that text was truncated. Removing the just-typed character OTOH is something he will notice very quickly.

Definition at line 112 of file YQMultiLineEdit.cc.

◆ preferredHeight()

int YQMultiLineEdit::preferredHeight ( )
virtual

Preferred height of the widget.

Reimplemented from YWidget.

Definition at line 142 of file YQMultiLineEdit.cc.

◆ preferredWidth()

int YQMultiLineEdit::preferredWidth ( )
virtual

Preferred width of the widget.

Reimplemented from YWidget.

Definition at line 136 of file YQMultiLineEdit.cc.

◆ setEnabled()

void YQMultiLineEdit::setEnabled ( bool  enabled)
virtual

Set enabled/disabled state.

Reimplemented from YWidget.

Definition at line 128 of file YQMultiLineEdit.cc.

◆ setInputMaxLength()

void YQMultiLineEdit::setInputMaxLength ( int  numberOfChars)
virtual

Set the maximum input length, i.e., the maximum number of characters the user can enter.

-1 means no limit.

Reimplemented from YMultiLineEdit.

Definition at line 98 of file YQMultiLineEdit.cc.

◆ setLabel()

void YQMultiLineEdit::setLabel ( const std::string &  label)
virtual

Set the label (the caption above the MultiLineEdit).

Reimplemented from YMultiLineEdit.

Definition at line 91 of file YQMultiLineEdit.cc.

Here is the call graph for this function:

◆ setSize()

void YQMultiLineEdit::setSize ( int  newWidth,
int  newHeight 
)
virtual

Set the new size of the widget.

Reimplemented from YWidget.

Definition at line 154 of file YQMultiLineEdit.cc.

◆ setValue()

void YQMultiLineEdit::setValue ( const std::string &  text)
virtual

Set the current value (the text entered by the user or set from the outside) of this MultiLineEdit.

Implemented from YMultiLineEdit.

Definition at line 83 of file YQMultiLineEdit.cc.

◆ value()

string YQMultiLineEdit::value ( )
virtual

Get the current value (the text entered by the user or set from the outside) of this MultiLineEdit.

Implemented from YMultiLineEdit.

Definition at line 77 of file YQMultiLineEdit.cc.


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