- Qt Creator Manual
- Create UML-style models
- Qt Creator Manual 13.0.0

How To

# Create UML-style models

You can use wizards to create UML-style models and scratch models.

To create models and edit them in the model editor:

1. Select File > New File > Modeling > Model > Choose.

   The model file opens in the model editor.

2. Drag model elements to the editor and select them to specify properties for them:

   A package diagram in the model editor.

   1. In the Stereotypes field, enter the stereotype to apply to the model element or select a predefined stereotype from the list.
   2. In the Name field, give a name to the model element.
   3. Select the Auto sized check box to reset the element to its default size after you have changed the element size by dragging its borders.
   4. In the Color field, select the color of the model element.
   5. In the Role field, select a role to make the model element color lighter, darker, or softer. You can also remove color and draw the element outline or flatten the element by removing gradients.
   6. Select the Emphasized check box to draw the model element with a thicker line.
   7. In the Stereotype display field, select:
      - Smart to display the stereotype as a Label, a Decoration, or an Icon, depending on the properties of the element. For example, if a class has the stereotype interface, it is displayed as an icon until it becomes displayed members, after which it is displayed as a decoration.
      - None to suppress the displaying of the stereotype.
      - Label to display the stereotype as a line of text using the standard form above the element name even if the stereotype defines a custom icon.
      - Decoration to show the standard form of the element with the stereotype as a small icon placed top right if the stereotype defines a custom icon.
      - Icon to display the element using the custom icon.
3. To create a relation between two elements, select the arrow icon next to an element and drag it to the end point of the relation.
4. Select the relation to specify settings for it, according to its type: inheritance, association, or dependency. You can specify the following settings for dependency relations, which are available for all element types:
   1. In the Stereotypes field, select the stereotype to apply to the relation.
   2. In the Name field, give a name to the relation.
   3. In the Direction field, you can change the direction of the connection or make it bidirectional.
5. To move the end of a relation to a different element, drag the end point over another element that accepts relations of that type. For example, only classes accept inheritances and associations.
6. To create sampling points that divide a relation into two connected lines, select a relation and press Shift and click on the relation line.

   If possible, the end point of a relation is moved automatically to draw the line to the next sampling point either vertically or horizontally.

7. To remove a sampling point, press Ctrl and click the sampling point.
8. To group elements, drag a Boundary element to the editor and resize it to enclose the elements in the group.

## Create scratch models

Use a scratch model to quickly put a temporary diagram together. The wizard creates the model file in a temporary folder without any input from you. Therefore, you can assign a keyboard shortcut to the wizard and use it to create and open models with empty diagrams.

To create a scratch model, select File > New File > Modeling > Scratch Model > Choose.

See also Create class diagrams, Create component diagrams, Create package diagrams, and Model Editor.