Files
RedBear-OS/local/recipes/kde/kirigami/source/src/spellcheckattached.h
T
vasilito ce0ac10b6d chore: sync all pending changes — kirigami platform headers, cookbook fix, docs, patches
Kirigami: remove stub .cpp, add Qt platform integration headers for
QML gate. Matches KDE src/pattern for direct header-only builds.

Cookbook: add --no-backup-if-mismatch to patch invocation (fetch.rs).

Kernel: consolidate patch chain, add debug-scheme-serial-fix.

Docs: archive old audit reports, add CHANGELOG and hardware validation
matrix. Update AGENTS.md with Linux reference source policy.

Scripts: add test-network-qemu.sh, test-storage-qemu.sh.

.gitignore: add local/reference/ exclusion.
2026-05-04 11:57:48 +01:00

70 lines
1.8 KiB
C++

// SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu>
// SPDX-License-Identifier: LGPL-2.0-or-later
#ifndef SPELLCHECKATTACHED_H
#define SPELLCHECKATTACHED_H
#include <QObject>
#include <QQmlEngine>
#include <qqmlregistration.h>
/**
* @brief This attached property contains hints for spell checker.
*
* @warning Kirigami doesn't provide any spell checker per se, this is just a
* hint for QQC2 style implementation and other downstream components. If you
* want to add spell checking to your custom application theme checkout
* \ref Sonnet.
*
* @code
* import QtQuick.Controls as QQC2
* import org.kde.kirigami as Kirigami
*
* QQC2.TextArea {
* Kirigami.SpellCheck.enabled: true
* }
* @endcode
*
* @author Carl Schwan <carl@carlschwan.eu>
* @since 2.18
*/
class SpellCheckAttached : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_NAMED_ELEMENT(SpellCheck)
QML_UNCREATABLE("Attached property only")
QML_ATTACHED(SpellCheckAttached)
/**
* This property holds whether the spell checking should be enabled on the
* TextField/TextArea.
*
* @note By default, false. This might change in KF6, so if you don't want
* spellcheck in your application, explicitly set it to false.
*
* @since 2.18
*/
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged FINAL)
public:
explicit SpellCheckAttached(QObject *parent = nullptr);
~SpellCheckAttached() override;
void setEnabled(bool enabled);
bool enabled() const;
// QML attached property
static SpellCheckAttached *qmlAttachedProperties(QObject *object);
Q_SIGNALS:
void enabledChanged();
private:
bool m_enabled = false;
};
QML_DECLARE_TYPEINFO(SpellCheckAttached, QML_HAS_ATTACHED_PROPERTIES)
#endif // SPELLCHECKATTACHED_H