You can use the Rectangle component to draw basic shapes in Form Editor.
Most visual components in Library are based on the Item component. 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 components, such as position, size, and visibility. For more information, see Specifying Basic Component Properties.
In addition, each component 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.
The basic Rectangle component 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.
© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.