6#include <QtQml/qqmlinfo.h>
76#define DEFINE_ROLE_PROPERTIES(getterGetterName, getterSetterName, getterSignal, setterGetterName, setterSetterName, setterSignal, roleName) \
77QJSValue QQmlTableModelColumn::getterGetterName() const \
79 return mGetters.value(roleName); \
82void QQmlTableModelColumn::getterSetterName(const QJSValue &stringOrFunction) \
84 if (!stringOrFunction.isString() && !stringOrFunction.isCallable()) { \
85 qmlWarning(this).quote() << "getter for " << roleName << " must be a function"; \
88 if (stringOrFunction.strictlyEquals(decoration())) \
91 mGetters[roleName] = stringOrFunction; \
92 emit decorationChanged(); \
95QJSValue QQmlTableModelColumn::setterGetterName() const \
97 return mSetters.value(roleName); \
100void QQmlTableModelColumn::setterSetterName(const QJSValue &function) \
102 if (!function.isCallable()) { \
103 qmlWarning(this).quote() << "setter for " << roleName << " must be a function"; \
107 if (function.strictlyEquals(getSetDisplay())) \
110 mSetters[roleName] = function; \
111 emit setDisplayChanged(); \
148 auto it = mGetters.
find(roleName);
149 if (
it == mGetters.
end())
156 auto it = mSetters.
find(roleName);
157 if (
it == mSetters.
end())
169 static const QHash<int, QString>
names {
190#include "moc_qqmltablemodelcolumn_p.cpp"
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
The QJSValue class acts as a container for Qt/JavaScript data types.
~QQmlTableModelColumn() override
QJSValue setterAtRole(const QString &roleName)
static const QHash< int, QString > supportedRoleNames()
QQmlTableModelColumn(QObject *parent=nullptr)
const QHash< QString, QJSValue > getters() const
iterator find(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QSet< QString >::iterator it
struct wl_display * display
Combined button and popup list for selecting options.
@ AccessibleDescriptionRole
static constexpr QLatin1StringView accessibleDescriptionRoleName("accessibleDescription")
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName accessibleTextRoleName setSizeHintChanged
static constexpr QLatin1StringView decorationRoleName("decoration")
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName accessibleTextRoleName setSizeHint
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName setForegroundChanged
decorationRoleName toolTipRoleName setSetWhatsThis
decorationRoleName setSetToolTip
decorationRoleName toolTipRoleName getSetWhatsThis
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName accessibleTextRoleName sizeHintChanged
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName setSetAccessibleText
static constexpr QLatin1StringView backgroundRoleName("background")
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName accessibleTextRoleName setSetSizeHint
decorationRoleName toolTipRoleName setWhatsThisChanged
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundChanged
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName setAccessibleTextChanged
static constexpr QLatin1StringView whatsThisRoleName("whatsThis")
static constexpr QLatin1StringView editRoleName("edit")
decorationRoleName toolTipRoleName whatsThisRoleName setTextAlignmentChanged
decorationRoleName toolTipRoleName whatsThisRoleName setSetTextAlignment
decorationRoleName toolTipChanged
static constexpr QLatin1StringView statusTipRoleName("statusTip")
decorationRoleName toolTipRoleName whatsThisRoleName setTextAlignment
decorationRoleName toolTipRoleName setWhatsThis
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName setForeground
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName accessibleTextChanged
static QT_BEGIN_NAMESPACE constexpr QLatin1StringView displayRoleName("display")
Represents a column in a model.
decorationRoleName getSetToolTip
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName getSetForeground
decorationRoleName toolTipRoleName whatsThisChanged
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentChanged
static constexpr QLatin1StringView checkStateRoleName("checkState")
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName accessibleTextRoleName getSetSizeHint
decorationRoleName setToolTipChanged
static constexpr QLatin1StringView fontRoleName("font")
#define DEFINE_ROLE_PROPERTIES(getterGetterName, getterSetterName, getterSignal, setterGetterName, setterSetterName, setterSignal, roleName)
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName setAccessibleText
static constexpr QLatin1StringView foregroundRoleName("foreground")
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName foregroundRoleName getSetAccessibleText
decorationRoleName toolTipRoleName whatsThisRoleName getSetTextAlignment
static constexpr QLatin1StringView sizeHintRoleName("sizeHint")
decorationRoleName toolTipRoleName whatsThisRoleName textAlignmentRoleName setSetForeground
decorationRoleName setToolTip
static constexpr QLatin1StringView accessibleTextRoleName("accessibleText")
static constexpr QLatin1StringView toolTipRoleName("toolTip")
static constexpr QLatin1StringView textAlignmentRoleName("textAlignment")