QGraphicsAnchor 类

QGraphicsAnchor 类表示的锚点介于 2 项之间在 QGraphicsAnchorLayout . 更多...

头: #include <QGraphicsAnchor>
CMake: find_package(Qt6 COMPONENTS Widgets REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QObject

特性

公共函数

virtual ~QGraphicsAnchor ()
void setSizePolicy (QSizePolicy::Policy policy )
void setSpacing (qreal spacing )
QSizePolicy::Policy sizePolicy () const
qreal spacing () const
void unsetSpacing ()

详细描述

The graphics anchor provides an API that enables you to query and manipulate the properties an anchor has. When an anchor is added to the layout with QGraphicsAnchorLayout::addAnchor (), a QGraphicsAnchor instance is returned where the properties are initialized to their default values. The properties can then be further changed, and they will be picked up the next time the layout is activated.

另请参阅 QGraphicsAnchorLayout::anchor ().

特性文档编制

sizePolicy : QSizePolicy::Policy

此特性保持大小策略为 QGraphicsAnchor .

By setting the size policy on an anchor you can configure how the anchor can resize itself from its preferred spacing. For instance, if the anchor has the size policy QSizePolicy::Minimum , the spacing is the minimum size of the anchor. However, its size can grow up to the anchors maximum size. If the default size policy is QSizePolicy::Fixed , the anchor can neither grow or shrink, which means that the only size the anchor can have is the spacing. QSizePolicy::Fixed is the default size policy. QGraphicsAnchor always has a minimum spacing of 0 and a very large maximum spacing.

访问函数:

QSizePolicy::Policy sizePolicy () const
void setSizePolicy (QSizePolicy::Policy policy )

另请参阅 QGraphicsAnchor::spacing .

spacing : qreal

This property holds the preferred space between items in the QGraphicsAnchorLayout .

Depending on the anchor type, the default spacing is either 0 or a value returned from the style.

访问函数:

qreal spacing () const
void setSpacing (qreal spacing )
void unsetSpacing ()

另请参阅 QGraphicsAnchorLayout::addAnchor ().

成员函数文档编制

[虚拟] QGraphicsAnchor:: ~QGraphicsAnchor ()

移除 QGraphicsAnchor 对象从布局并销毁它。