View Validity Checking

Goal

The goal is to add additional feedback to make it easy to see incomplete or invalid information in a Tabbed Group View based on its children View state.

Proposed Approach

Add view::BaseView::isValid Method

Virtual method that returns true if the View is valid and false otherwise. The following is the proposed behavior:

View Behavior
qtAnalaysisView True if all “active” non-optional items in the Analysis attribute are set and that there is at least one item active.
qtAssociationView True if its association constraint (if present) is satisfied. An association constraint requires all components that can be associated with a specific type of attribute have been associated.
qtAttributeView True if all attributes are valid and association constraint (if present) is satisfied. An association constraint requires all components that can be associated with a specific type of attribute have been associated.
qtCategorySelectorView True if the active View is valid.
qtGroupView True if all of its children are valid.
qtInstanceView True if all of its attributes are valid.
qtSelectorView True if the selected View is valid.

Notification

There needs to a signal to indicate if a view has been modified. For the time being I propose we use qtBaseAttributeView::modified signal.

Indicating Invalid Views

The current approach would be to place the invalid icon in a Group View’s tab for the invalid children Views. We could get more creative by changing frame colors (pink for there is a problem and normal for ok).

@chart3388 @amuhsin @johnt FYI - John, we might want Neil to sign up to discourse.

Comments?

@Bob_Obara Will any of the validity checking be available in smtk/attribute/utility/Queries? I ask because one use case for the new badge work is showing when a model entity is missing a mandatory attribute. The badge will have access to the model::Entity (via the descriptive phrase) and can get to the resource manager (so it could find attribute resources linked to the Entity’s parent resource).

Interesting question - the current requirement that all “appropriate” objects must have an attribute of type “foo” associated with it is stored in the attribute view specification not on the Definition itself.

Will your phrase know that the requirement exists?