Shapes | Qt Creator Manual

- Qt Creator Manual
- Shapes
- Qt Creator Manual 4.13.3

Editing 2D Content ◦ Creating Buttons

# Shapes

You can use the Rectangle type to draw basic shapes in Form Editor.

Most visual types in Library are based on the Item type. Even though it has no visual appearance itself (similarly to a mouse area, for example), it defines all the properties that are common across visual types, such as position, size, and visibility. For more information, see Specifying Basic Item Properties.

In addition, each type has a set of properties that specify its visual appearance and behavior. You can modify the property values to set fill and border colors, stroke width, and other characteristics of the shapes.

The following sections describe the available shapes and their properties in more detail. You can modify the values of the properties in the Properties view.

## Rectangle

The basic Rectangle QML type is used for drawing shapes with four sides and corners, as well as a solid border.

Rectangles can be filled either with a solid fill color or a linear gradient that you set in the Color field. You can also use a color picker to select colors and a gradient picker to select gradients from a predefined set of WebGradients.

An optional solid border can be added to a rectangle with its own color and thickness by setting the values of the Border Color and Border fields. To create a border without a fill color, select the button that sets the color to transparent.

By setting the value of the Radius field, you can create shapes with rounded corners. With the right combination of the values of the rectangle width, height, and radius properties, you can create oval and circular shapes. For example, to draw a full circle, first draw a rectangle with all four sides equal, and then set its radius to half the side length.

When drawing curved edges, consider enabling the Antialiasing check box in the Advanced tab of the Properties view to improve the appearance of your shape.

Editing 2D Content ◦ Creating Buttons