digiKam
Loading...
Searching...
No Matches
Digikam::DTextEdit Class Reference

#include <dtextedit.h>

+ Inheritance diagram for Digikam::DTextEdit:

Classes

class  Private
 

Signals

void editingFinished ()
 
void returnPressed ()
 
void textEdited (const QString &)
 

Public Member Functions

QString acceptedCharacters () const
 
QString currentLanguage () const
 
 DTextEdit (const QString &contents, QWidget *const parent=nullptr)
 
 DTextEdit (QWidget *const parent=nullptr)
 
 DTextEdit (unsigned int lines, QWidget *const parent=nullptr)
 
QString ignoredCharacters () const
 
bool isClearButtonEnabled () const
 
int leftCharacters () const
 
unsigned int linesVisible () const
 
int maxLength () const
 
void setAcceptedCharacters (const QString &mask)
 
void setClearButtonEnabled (bool enable)
 
void setCurrentLanguage (const QString &lang)
 
void setIgnoredCharacters (const QString &mask)
 
void setLinesVisible (unsigned int lines)
 
void setLocalizeSettings (const LocalizeContainer &settings)
 
void setMaxLength (int length)
 
void setText (const QString &text)
 
LocalizeContainer spellCheckSettings () const
 
QString text () const
 
 ~DTextEdit () override
 

Protected Member Functions

void focusOutEvent (QFocusEvent *e) override
 
void insertFromMimeData (const QMimeData *source) override
 
void keyPressEvent (QKeyEvent *e) override
 

Detailed Description

A text edit widget based on QTextEdit with spell checker capabilities based on Sonnet (optional). Widget size can be constrained with the number of visible lines. A single line constraint will emulate QLineEdit. See setLinesVisible() for details. The maximum number of characters can be limited with setMaxLenght(). The characters can be limited in editor by setIgnoredCharacters() and setAcceptedCharacters(). Implementation: dtextedit.cpp

Constructor & Destructor Documentation

◆ DTextEdit() [1/3]

Digikam::DTextEdit::DTextEdit ( QWidget *const  parent = nullptr)
explicit

Default constructor.

References Digikam::DTextEdit::Private::init().

◆ DTextEdit() [2/3]

Digikam::DTextEdit::DTextEdit ( unsigned int  lines,
QWidget *const  parent = nullptr 
)
explicit

Constructor with a number of lines. Zero lines do not apply a size constraint.

References Digikam::DTextEdit::Private::init(), and Digikam::DTextEdit::Private::lines.

◆ DTextEdit() [3/3]

Digikam::DTextEdit::DTextEdit ( const QString &  contents,
QWidget *const  parent = nullptr 
)
explicit

Constructor with text contents to use.

References Digikam::DTextEdit::Private::init().

◆ ~DTextEdit()

Digikam::DTextEdit::~DTextEdit ( )
override

Standard destructor.

Member Function Documentation

◆ acceptedCharacters()

QString Digikam::DTextEdit::acceptedCharacters ( ) const

This property holds whether the edit widget handle the mask of accepted characters in text editor. The mask of characters is passed as string (ex: "abcABC"). By default the mask is empty.

References Digikam::DTextEdit::Private::acceptedMask.

◆ currentLanguage()

QString Digikam::DTextEdit::currentLanguage ( ) const

Referenced by setCurrentLanguage().

◆ editingFinished

void Digikam::DTextEdit::editingFinished ( )
signal

Referenced by focusOutEvent().

◆ focusOutEvent()

void Digikam::DTextEdit::focusOutEvent ( QFocusEvent *  e)
overrideprotected

References editingFinished().

◆ ignoredCharacters()

QString Digikam::DTextEdit::ignoredCharacters ( ) const

This property holds whether the edit widget handle the mask of ignored characters in text editor. The mask of characters is passed as string (ex: "+/!()"). By default the mask is empty.

References Digikam::DTextEdit::Private::ignoredMask.

◆ insertFromMimeData()

void Digikam::DTextEdit::insertFromMimeData ( const QMimeData *  source)
overrideprotected

◆ isClearButtonEnabled()

bool Digikam::DTextEdit::isClearButtonEnabled ( ) const

This property holds whether the edit widget displays a clear button when it is not empty. If enabled, the edit widget displays a trailing clear button when it contains some text, otherwise the edit widget does not show a clear button. This option only take effect in QLineEdit emulation mode when lines visible is set to 1. See setLinesVisible() for details.

References Digikam::DTextEdit::Private::clearBtnEnable.

◆ keyPressEvent()

◆ leftCharacters()

int Digikam::DTextEdit::leftCharacters ( ) const

Return the left characters that user can enter if a limit have been previously set with setMaxLeght().

References Digikam::DTextEdit::Private::maxLength.

◆ linesVisible()

unsigned int Digikam::DTextEdit::linesVisible ( ) const

◆ maxLength()

int Digikam::DTextEdit::maxLength ( ) const

◆ returnPressed

void Digikam::DTextEdit::returnPressed ( )
signal

Emmited only when mimic QLineEdit mode is enabled. See setLinesVisible() for details.

Referenced by keyPressEvent().

◆ setAcceptedCharacters()

void Digikam::DTextEdit::setAcceptedCharacters ( const QString &  mask)

◆ setClearButtonEnabled()

void Digikam::DTextEdit::setClearButtonEnabled ( bool  enable)

◆ setCurrentLanguage()

void Digikam::DTextEdit::setCurrentLanguage ( const QString &  lang)

This property holds whether the edit widget handle a specific spell-checker language (2 letters code based as "en", "fr", "es", etc.). If this property is not set, spell-checker will try to auto-detect language by parsing the text. To reset this setting, pass a empty string as language. If Sonnet depedencies is not resolved, these method do nothing.

References Digikam::DTextEdit::Private::container, currentLanguage(), and Digikam::LocalizeContainer::defaultLanguage.

Referenced by Digikam::AltLangStrEdit::slotSelectionChanged().

◆ setIgnoredCharacters()

void Digikam::DTextEdit::setIgnoredCharacters ( const QString &  mask)

◆ setLinesVisible()

void Digikam::DTextEdit::setLinesVisible ( unsigned int  lines)

This property holds whether the edit widget handle visible lines used by the widget to show text. Lines must be superior or egal to 1 to apply a size constraint. Notes: if a single visible line is used, the widget will emulate QLineEdit. a null value do not apply a size constraint.

References Digikam::DTextEdit::Private::lines.

Referenced by Digikam::SetupCollectionModel::askForNewCollectionPath(), Digikam::DTextEdit::Private::init(), and Digikam::SubjectWidget::SubjectWidget().

◆ setLocalizeSettings()

◆ setMaxLength()

void Digikam::DTextEdit::setMaxLength ( int  length)

This property holds whether the edit widget handle the maximum of characters that user can enter in editor. By default no limit is set. A zero length reset a limit.

References Digikam::DTextEdit::Private::maxLength, setText(), and text().

Referenced by Digikam::SubjectWidget::SubjectWidget().

◆ setText()

◆ spellCheckSettings()

LocalizeContainer Digikam::DTextEdit::spellCheckSettings ( ) const

This property holds whether the edit widget handle the Spellcheck settings. See LocalizeContainer class for details.

References Digikam::DTextEdit::Private::container.

◆ text()

QString Digikam::DTextEdit::text ( ) const

This property holds whether the edit widget handle text contents as plain text. If ignored or accepted characters masks are set, text is filtered accordingly.

Referenced by Digikam::SetupCollectionModel::askForNewCollectionPath(), Digikam::SubjectWidget::buildSubject(), Digikam::WSNewAlbumDialog::getBaseAlbumProperties(), Digikam::DTextEdit::Private::init(), insertFromMimeData(), keyPressEvent(), setMaxLength(), and setText().

◆ textEdited

void Digikam::DTextEdit::textEdited ( const QString &  )
signal

Referenced by keyPressEvent().


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