![]() |
digiKam
|
#include <dtextedit.h>
Classes | |
class | Private |
Signals | |
void | returnPressed () |
void | textEdited (const QString &) |
Public Member Functions | |
QString | acceptedCharacters () const |
QString | currentLanguage () const |
DPlainTextEdit (const QString &contents, QWidget *const parent=nullptr) | |
DPlainTextEdit (QWidget *const parent=nullptr) | |
DPlainTextEdit (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 |
~DPlainTextEdit () override | |
Protected Member Functions | |
void | insertFromMimeData (const QMimeData *source) override |
void | keyPressEvent (QKeyEvent *e) override |
A text edit widget based on QPlainTextEdit 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: dplaintextedit.cpp
|
explicit |
Default constructor.
References Digikam::DPlainTextEdit::Private::init().
|
explicit |
Constructor with a number of lines. Zero lines do not apply a size constraint.
References Digikam::DPlainTextEdit::Private::init(), and Digikam::DPlainTextEdit::Private::lines.
|
explicit |
Constructor with text contents to use.
References Digikam::DPlainTextEdit::Private::init().
|
override |
Standard destructor.
QString Digikam::DPlainTextEdit::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::DPlainTextEdit::Private::acceptedMask.
QString Digikam::DPlainTextEdit::currentLanguage | ( | ) | const |
Referenced by setCurrentLanguage().
QString Digikam::DPlainTextEdit::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::DPlainTextEdit::Private::ignoredMask.
|
overrideprotected |
bool Digikam::DPlainTextEdit::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::DPlainTextEdit::Private::clearBtnEnable.
|
overrideprotected |
int Digikam::DPlainTextEdit::leftCharacters | ( | ) | const |
Return the left characters that user can enter if a limit have been previously set with setMaxLeght().
References Digikam::DPlainTextEdit::Private::maxLength.
unsigned int Digikam::DPlainTextEdit::linesVisible | ( | ) | const |
References Digikam::DPlainTextEdit::Private::lines.
int Digikam::DPlainTextEdit::maxLength | ( | ) | const |
References Digikam::DPlainTextEdit::Private::maxLength.
|
signal |
Emmited only when mimic QLineEdit mode is enabled. See setLinesVisible() for details.
Referenced by keyPressEvent().
void Digikam::DPlainTextEdit::setAcceptedCharacters | ( | const QString & | mask | ) |
References Digikam::DPlainTextEdit::Private::acceptedMask.
void Digikam::DPlainTextEdit::setClearButtonEnabled | ( | bool | enable | ) |
References Digikam::DPlainTextEdit::Private::clearBtnEnable.
void Digikam::DPlainTextEdit::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::DPlainTextEdit::Private::container, currentLanguage(), and Digikam::LocalizeContainer::defaultLanguage.
void Digikam::DPlainTextEdit::setIgnoredCharacters | ( | const QString & | mask | ) |
References Digikam::DPlainTextEdit::Private::ignoredMask.
void Digikam::DPlainTextEdit::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 emulate QLineEdit. a null value do not apply a size constraint.
References Digikam::DPlainTextEdit::Private::lines.
Referenced by Digikam::DPlainTextEdit::Private::init().
void Digikam::DPlainTextEdit::setLocalizeSettings | ( | const LocalizeContainer & | settings | ) |
void Digikam::DPlainTextEdit::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::DPlainTextEdit::Private::maxLength, setText(), and text().
void Digikam::DPlainTextEdit::setText | ( | const QString & | text | ) |
References Digikam::DPlainTextEdit::Private::acceptedMask, Digikam::DPlainTextEdit::Private::ignoredMask, and text().
Referenced by setMaxLength().
LocalizeContainer Digikam::DPlainTextEdit::spellCheckSettings | ( | ) | const |
This property holds whether the edit widget handle the Spellcheck settings. See LocalizeContainer class for details.
References Digikam::DPlainTextEdit::Private::container.
QString Digikam::DPlainTextEdit::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::DPlainTextEdit::Private::init(), insertFromMimeData(), keyPressEvent(), setMaxLength(), and setText().
|
signal |
Referenced by keyPressEvent().