QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlPlainTextEdit Class Reference

A subclass of QPlainTextEdit with additional features. More...

Inheritance diagram for QtlPlainTextEdit:

Public Types

enum  FormatFlag {
  Monospace = 0x0001,
  AllCharacters = 0x0002,
  ToUpper = 0x0004,
  ToLower = 0x0008,
  Spaces = 0x0010,
  Ascii = 0x0020,
  Digits = 0x0040,
  Hexa = 0x0080,
  Letters = 0x0100
}
 Flags specifying the text format. More...
 

Public Member Functions

 QtlPlainTextEdit (QWidget *parent=0, FormatFlags format=AllCharacters)
 Constructor. More...
 
 QtlPlainTextEdit (const QString &text, QWidget *parent=0, FormatFlags format=AllCharacters)
 Constructor. More...
 
FormatFlags format () const
 Get the format flags. More...
 
void setFormat (const FormatFlags &format)
 Set the format flags. More...
 
void setPlainText (const QString &text)
 Set the plain text in the editor. More...
 

Protected Member Functions

virtual void insertFromMimeData (const QMimeData *source) Q_DECL_OVERRIDE
 Insert MIME data into the widget. More...
 
virtual void keyPressEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 Invoked when a key is pressed. More...
 

Private Member Functions

QString acceptableText (const QString &text) const
 Transform a text into an acceptable string for the current format. More...
 

Private Attributes

FormatFlags _format
 Format flags. More...
 
const QFont _standardFont
 Standard font for QPlainTextEdit. More...
 

Detailed Description

A subclass of QPlainTextEdit with additional features.

Member Enumeration Documentation

◆ FormatFlag

Flags specifying the text format.

Enumerator
Monospace 

Use a monospace font.

AllCharacters 

Allow all characters.

ToUpper 

Convert all letters to uppercase.

ToLower 

Convert all letters to lowercase.

Spaces 

Allow space characters.

Ascii 

Allow 7-bit ASCII characters.

Digits 

Allow decimal digits.

Hexa 

Allow hexadecimal digits.

Letters 

Allow letters.

Constructor & Destructor Documentation

◆ QtlPlainTextEdit() [1/2]

QtlPlainTextEdit::QtlPlainTextEdit ( QWidget *  parent = 0,
FormatFlags  format = AllCharacters 
)
explicit

Constructor.

Parameters
[in]parentOptional parent widget.
[in]formatFormat flags.

◆ QtlPlainTextEdit() [2/2]

QtlPlainTextEdit::QtlPlainTextEdit ( const QString &  text,
QWidget *  parent = 0,
FormatFlags  format = AllCharacters 
)
explicit

Constructor.

Parameters
[in]textInitial content.
[in]parentOptional parent widget.
[in]formatFormat flags.

Member Function Documentation

◆ format()

FormatFlags QtlPlainTextEdit::format ( ) const
inline

Get the format flags.

Returns
The format flags.

◆ setFormat()

void QtlPlainTextEdit::setFormat ( const FormatFlags &  format)

Set the format flags.

Parameters
[in]formatThe format flags.

◆ setPlainText()

void QtlPlainTextEdit::setPlainText ( const QString &  text)

Set the plain text in the editor.

Reimplemented from QPlainTextEdit.

Parameters
[in]textThe text to set.

◆ keyPressEvent()

void QtlPlainTextEdit::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Invoked when a key is pressed.

Reimplemented from superclass.

Parameters
[in,out]eventThe event to process.

◆ insertFromMimeData()

void QtlPlainTextEdit::insertFromMimeData ( const QMimeData *  source)
protectedvirtual

Insert MIME data into the widget.

Reimplemented from QPlainTextEdit.

Parameters
[in]sourceSource data to check.

◆ acceptableText()

QString QtlPlainTextEdit::acceptableText ( const QString &  text) const
private

Transform a text into an acceptable string for the current format.

Parameters
[in]textThe text to transform.
Returns
The transformed text.

Member Data Documentation

◆ _standardFont

const QFont QtlPlainTextEdit::_standardFont
private

Standard font for QPlainTextEdit.

◆ _format

FormatFlags QtlPlainTextEdit::_format
private

Format flags.


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