2#include "qml_material/style/common_state.hpp"
6class QML_MATERIAL_API InputState :
public CommonState {
9 Q_PROPERTY(
bool error READ error WRITE setError RESET resetError NOTIFY errorChanged BINDABLE
12 ~InputState()
override;
16 QBindable<bool> bindableError();
17 Q_SIGNAL
void errorChanged();
18 Q_SIGNAL
void itemChanged();
21 explicit InputState(QObject* parent =
nullptr);
22 enum class Interaction
31 StateBindingSet<Interaction> m_bindings { Interaction::Base };
32 QProperty<bool> m_acceptable {
true }, m_focused {
false }, m_hovered {
false };
33 QQuickItem* inputItem()
const;
34 void setInputItem(QQuickItem*);
35 void bindInputAppearance(
const PropertyKey<QColor>& label,
const PropertyKey<qreal>& opacity);
39 Interaction state = Interaction::Base;
40 quint64 generation = 0;
41 bool operator==(
const Selection&)
const =
default;
43 void selectionChanged();
44 QProperty<QQuickItem*> m_item {
nullptr };
45 QProperty<bool> m_disabled {
false };
46 QList<QMetaObject::Connection> m_connections;
48 Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS(InputState,
bool, m_error,
false,
49 &InputState::errorChanged)
50 Q_OBJECT_BINDABLE_PROPERTY(InputState, Selection, m_selection, &InputState::selectionChanged)