|
FOSSredder 0.5.0
|
Owns editable property UI state and delegates property CRUD to workspace. More...
#include <PropertyViewModel.h>


Signals | |
| void | changed () |
| Emitted when property view model state changed. | |
Public Member Functions | |
| PropertyViewModel (WorkspaceStore *store, WorkspaceCommands *commands, WorkspaceSelection *selection, WorkspaceSelectors *selectors, QObject *parent=nullptr) | |
| Creates the property view model bound to workspace roles. | |
| QString | currentId () const |
| Returns the currently selected property id. | |
| QString | name () const |
| Returns the editable property name. | |
| void | setName (const QString &value) |
| Updates the editable property name. | |
| QVariantList | aliases () const |
| Returns editable property aliases. | |
| void | setAliases (const QVariantList &value) |
| Replaces editable property aliases. | |
| QString | aliasInputText () const |
| Returns the current alias input text. | |
| void | setAliasInputText (const QString &value) |
| Updates the current alias input text. | |
| int | aliasIndex () const |
| Returns the selected alias index. | |
| void | setAliasIndex (int value) |
| Updates the selected alias index. | |
| QVariantList | selectedContractIds () const |
| Returns selected contract ids in the property form. | |
| void | setSelectedContractIds (const QVariantList &value) |
| Replaces selected contract ids in the property form. | |
| bool | isEdit () const |
| Checks whether the form edits an existing property. | |
| bool | hasChanges () const |
| Checks whether the editable form differs from the loaded property. | |
| bool | canSubmit () const |
| Checks whether the form has enough UI data to submit. | |
| QVariantList | propertyRows () const |
| Returns property sidebar rows. | |
| QVariantList | contractRows () const |
| Returns selectable contract rows for the property form. | |
| Q_INVOKABLE void | selectProperty (const QString &id) |
| Selects a property for editing. | |
| Q_INVOKABLE bool | canAddAlias (const QString &value) const |
| Checks whether an alias value can be added to the form. | |
| Q_INVOKABLE void | addAlias (const QString &value) |
| Adds an alias to the property form. | |
| Q_INVOKABLE void | requestRemoveSelectedAlias () |
| Removes the currently selected alias when possible. | |
| Q_INVOKABLE void | enterCreateMode () |
| Clears selection and opens an empty create form. | |
| Q_INVOKABLE void | previous () |
| Selects the previous property row. | |
| Q_INVOKABLE void | next () |
| Selects the next property row. | |
| Q_INVOKABLE QString | submit () |
| Creates or updates the property through workspace commands. | |
| Q_INVOKABLE void | deleteCurrent () |
| Deletes the selected property through workspace commands. | |
| Q_INVOKABLE void | clear () |
| Clears the editable property form. | |
| Q_INVOKABLE void | setContractSelected (const QString &contractId, bool selected) |
| Adds or removes a contract id from the property form selection. | |
Properties | |
| QString | currentId |
| QString | name |
| QVariantList | aliases |
| QString | aliasInputText |
| int | aliasIndex |
| QVariantList | selectedContractIds |
| QVariantList | propertyRows |
| QVariantList | contractRows |
| bool | isEdit |
| bool | hasChanges |
| bool | canSubmit |
Owns editable property UI state and delegates property CRUD to workspace.
Definition at line 25 of file PropertyViewModel.h.
|
explicit |
Creates the property view model bound to workspace roles.
| parent | Optional QObject parent. |
Definition at line 260 of file PropertyViewModel.cpp.
| void ui::PropertyViewModel::addAlias | ( | const QString & | value | ) |
Adds an alias to the property form.
| value | Alias text to add. |
Definition at line 338 of file PropertyViewModel.cpp.

|
inline |
Returns editable property aliases.
Definition at line 72 of file PropertyViewModel.h.
|
inline |
Returns the selected alias index.
Definition at line 96 of file PropertyViewModel.h.
|
inline |
Returns the current alias input text.
Definition at line 84 of file PropertyViewModel.h.
| bool ui::PropertyViewModel::canAddAlias | ( | const QString & | value | ) | const |
Checks whether an alias value can be added to the form.
| value | Alias text to inspect. |
Definition at line 330 of file PropertyViewModel.cpp.
| bool ui::PropertyViewModel::canSubmit | ( | ) | const |
Checks whether the form has enough UI data to submit.
Definition at line 318 of file PropertyViewModel.cpp.
|
signal |
Emitted when property view model state changed.

| void ui::PropertyViewModel::clear | ( | ) |
Clears the editable property form.
Definition at line 411 of file PropertyViewModel.cpp.
| QVariantList ui::PropertyViewModel::contractRows | ( | ) | const |
Returns selectable contract rows for the property form.
Definition at line 433 of file PropertyViewModel.cpp.
| QString ui::PropertyViewModel::currentId | ( | ) | const |
Returns the currently selected property id.
Definition at line 425 of file PropertyViewModel.cpp.
| void ui::PropertyViewModel::deleteCurrent | ( | ) |
Deletes the selected property through workspace commands.
Definition at line 398 of file PropertyViewModel.cpp.

| void ui::PropertyViewModel::enterCreateMode | ( | ) |
Clears selection and opens an empty create form.
Definition at line 353 of file PropertyViewModel.cpp.
| bool ui::PropertyViewModel::hasChanges | ( | ) | const |
Checks whether the editable form differs from the loaded property.
Definition at line 322 of file PropertyViewModel.cpp.
| bool ui::PropertyViewModel::isEdit | ( | ) | const |
Checks whether the form edits an existing property.
Definition at line 314 of file PropertyViewModel.cpp.
|
inline |
Returns the editable property name.
Definition at line 60 of file PropertyViewModel.h.
| void ui::PropertyViewModel::next | ( | ) |
Selects the next property row.
Definition at line 369 of file PropertyViewModel.cpp.
| void ui::PropertyViewModel::previous | ( | ) |
Selects the previous property row.
Definition at line 360 of file PropertyViewModel.cpp.
| QVariantList ui::PropertyViewModel::propertyRows | ( | ) | const |
Returns property sidebar rows.
Definition at line 429 of file PropertyViewModel.cpp.
| void ui::PropertyViewModel::requestRemoveSelectedAlias | ( | ) |
Removes the currently selected alias when possible.
Definition at line 345 of file PropertyViewModel.cpp.

|
inline |
Returns selected contract ids in the property form.
Definition at line 108 of file PropertyViewModel.h.
| void ui::PropertyViewModel::selectProperty | ( | const QString & | id | ) |
Selects a property for editing.
| id | Property id selected by the QML sidebar. |
Definition at line 443 of file PropertyViewModel.cpp.
| void ui::PropertyViewModel::setAliases | ( | const QVariantList & | value | ) |
Replaces editable property aliases.
| value | New alias list. |
Definition at line 279 of file PropertyViewModel.cpp.

| void ui::PropertyViewModel::setAliasIndex | ( | int | value | ) |
Updates the selected alias index.
| value | New selected alias index. |
Definition at line 298 of file PropertyViewModel.cpp.

| void ui::PropertyViewModel::setAliasInputText | ( | const QString & | value | ) |
Updates the current alias input text.
| value | New alias input text. |
Definition at line 290 of file PropertyViewModel.cpp.

| void ui::PropertyViewModel::setContractSelected | ( | const QString & | contractId, |
| bool | selected ) |
Adds or removes a contract id from the property form selection.
| contractId | Contract id to toggle. |
| selected | Whether the contract should be selected. |
Definition at line 417 of file PropertyViewModel.cpp.

| void ui::PropertyViewModel::setName | ( | const QString & | value | ) |
Updates the editable property name.
| value | New form name. |
Definition at line 271 of file PropertyViewModel.cpp.

| void ui::PropertyViewModel::setSelectedContractIds | ( | const QVariantList & | value | ) |
Replaces selected contract ids in the property form.
| value | New selected contract ids. |
Definition at line 306 of file PropertyViewModel.cpp.

| QString ui::PropertyViewModel::submit | ( | ) |
Creates or updates the property through workspace commands.
Definition at line 378 of file PropertyViewModel.cpp.

|
readwrite |
Definition at line 29 of file PropertyViewModel.h.
|
readwrite |
Definition at line 32 of file PropertyViewModel.h.
|
readwrite |
Definition at line 30 of file PropertyViewModel.h.
|
read |
Definition at line 39 of file PropertyViewModel.h.
|
read |
Definition at line 36 of file PropertyViewModel.h.
|
read |
Definition at line 27 of file PropertyViewModel.h.
|
read |
Definition at line 38 of file PropertyViewModel.h.
|
read |
Definition at line 37 of file PropertyViewModel.h.
|
readwrite |
Definition at line 28 of file PropertyViewModel.h.
|
read |
Definition at line 35 of file PropertyViewModel.h.
|
read |
Definition at line 33 of file PropertyViewModel.h.