Sonnet::Settings Class

class Sonnet::Settings
Header: #include <Sonnet/Settings>
CMake: find_package(KF6 REQUIRED COMPONENTS Sonnet)
target_link_libraries(mytarget PRIVATE KF6::SonnetCore)
Inherits: QObject

Public Types

enum DictionaryRoles { LanguageCodeRole, PreferredRole, DefaultRole }

Properties

Public Functions

Settings(QObject *parent = nullptr)
bool autodetectLanguage() const
bool backgroundCheckerEnabled() const
bool checkerEnabledByDefault() const
QStringList currentIgnoreList() const
QString defaultLanguage() const
QAbstractListModel *dictionaryModel()
bool modified() const
QStringList preferredLanguages() const
void save()
void setAutodetectLanguage(bool)
void setBackgroundCheckerEnabled(bool)
void setCheckerEnabledByDefault(bool)
void setCurrentIgnoreList(const QStringList &ignores)
void setDefaultLanguage(const QString &lang)
void setPreferredLanguages(const QStringList &lang)
void setSkipRunTogether(bool)
void setSkipUppercase(bool)
bool skipRunTogether() const
bool skipUppercase() const

Signals

Detailed Description

Member Type Documentation

enum Settings::DictionaryRoles

Roles for dictionaryModel

ConstantValueDescription
Sonnet::Settings::LanguageCodeRoleQt::UserRole + 1Language code of the language. This uses "languageCode" as roleNames.
Sonnet::Settings::PreferredRole258This role holds whether the language is one of the preferred languages. This uses "isPreferred" as roleNames.
Sonnet::Settings::DefaultRole259This role holds whether the language is the default language. This uses "isDefault" as roleNames.

Property Documentation

autodetectLanguage : bool

This property holds whether Sonnet should autodetect language.

Access functions:

bool autodetectLanguage() const
void setAutodetectLanguage(bool)

Notifier signal:

void autodetectLanguageChanged()

backgroundCheckerEnabled : bool

This property holds whether Sonnet should run spellchecking checks in the background.

Access functions:

bool backgroundCheckerEnabled() const
void setBackgroundCheckerEnabled(bool)

Notifier signal:

void backgroundCheckerEnabledChanged()

checkerEnabledByDefault : bool

This property holds whether Sonnet should be enabled by default.

Access functions:

bool checkerEnabledByDefault() const
void setCheckerEnabledByDefault(bool)

Notifier signal:

void checkerEnabledByDefaultChanged()

currentIgnoreList : QStringList

This property holds the list of ignored words.

Access functions:

QStringList currentIgnoreList() const
void setCurrentIgnoreList(const QStringList &ignores)

Notifier signal:

void currentIgnoreListChanged()

defaultLanguage : QString

This property holds the default language for spell checking.

Access functions:

QString defaultLanguage() const
void setDefaultLanguage(const QString &lang)

Notifier signal:

void defaultLanguageChanged()

[read-only, since 5.88] dictionaryModel : QAbstractListModel* const

This property holds a Qt Model containing all the preferred dictionaries with language description and theirs codes. This model makes the Qt::DisplayRole as well as the roles defined in DictionaryRoles available.

This property was introduced in 5.88.

Access functions:

QAbstractListModel *dictionaryModel()

[read-only] modified : const bool

Access functions:

bool modified() const

Notifier signal:

void modifiedChanged()

preferredLanguages : QStringList

This property holds the list of preferred languages.

Access functions:

QStringList preferredLanguages() const
void setPreferredLanguages(const QStringList &lang)

Notifier signal:

void preferredLanguagesChanged()

skipRunTogether : bool

This property holds whether Sonnet should skip checking compounds words.

Access functions:

bool skipRunTogether() const
void setSkipRunTogether(bool)

Notifier signal:

void skipRunTogetherChanged()

skipUppercase : bool

This property holds whether Sonnet should skip checkign words starting with an uppercase letter.

Access functions:

bool skipUppercase() const
void setSkipUppercase(bool)

Notifier signal:

void skipUppercaseChanged()

Member Function Documentation

[explicit] Settings::Settings(QObject *parent = nullptr)

[invokable] void Settings::save()

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.