- Qt Creator Documentation
- Create UML-style models
- Qt Creator 20.0.1

Editing UML-style models ◦ Create class diagrams

# Create UML-style models

Use wizards to create UML-style models and scratch models.

To create models and edit them in the model editor:

1. Go to File > New File > Modeling > Model, and then select 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 Stereotypes, enter the stereotype to apply to the element or select a predefined stereotype from the list.
   2. In Name, give a name to the element.
   3. In Linked file, select a file to create a link to it from the element name.
   4. In Image, select an image to use as a custom icon for the element.
   5. Select Auto sized to reset the element to its default size after you changed the element size by dragging its borders.
   6. In Color, select the color of the element.
   7. In Role, 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.
   8. Select Emphasized to draw the model element with a thicker line.
   9. In Stereotype display, 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 Stereotypes, select the stereotype to apply to the relation.
   2. In Name, give a name to the relation.
   3. In Direction, 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 select 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, select Ctrl and select 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, go to File > New File > Modeling > Scratch Model, and then select Choose.

See also How to: Edit UML-style models and Editing UML-style models.

Editing UML-style models ◦ Create class diagrams