返回介绍

QSpacerItem Class

发布于 2019-10-04 15:02:50 字数 3029 浏览 1164 评论 0 收藏 0

The QSpacerItem class provides blank space in a layout. More...

#include <qlayout.h>

Inherits QLayoutItem.

List of all member functions.

Public Members

  • QSpacerItem ( intw, inth, QSizePolicy::SizeTypehData = QSizePolicy::Minimum, QSizePolicy::SizeTypevData = QSizePolicy::Minimum )
  • void changeSize ( intw, inth, QSizePolicy::SizeTypehData = QSizePolicy::Minimum, QSizePolicy::SizeTypevData = QSizePolicy::Minimum )
  • virtual QSize sizeHint () const
  • virtual QSize minimumSize () const
  • virtual QSize maximumSize () const
  • virtual QSizePolicy::ExpandData expanding () const
  • virtual bool isEmpty () const
  • virtual void setGeometry ( constQRect&r )

Detailed Description

The QSpacerItem class provides blank space in a layout.

This class is used by custom layouts.

See also QLayout, QLayout::spacerItem(), Widget Appearance and Style and Layout Management.


Member Function Documentation

QSpacerItem::QSpacerItem ( intw, inth, QSizePolicy::SizeTypehData = QSizePolicy::Minimum, QSizePolicy::SizeTypevData = QSizePolicy::Minimum )

Constructs a spacer item with preferred width w, preferred height h, horizontal size policy hData and vertical size policy vData.

The default values provide a gap that is able to stretch if nothing else wants the space.

void QSpacerItem::changeSize ( intw, inth, QSizePolicy::SizeTypehData = QSizePolicy::Minimum, QSizePolicy::SizeTypevData = QSizePolicy::Minimum )

Changes this spacer item to have preferred width w, preferred height h, horizontal size policy hData and vertical size policy vData.

The default values provide a gap that is able to stretch if nothing else wants the space.

QSizePolicy::ExpandData QSpacerItem::expanding () const [virtual]

Returns TRUE if this spacer item is expanding; otherwise returns FALSE.

Reimplemented from QLayoutItem.

bool QSpacerItem::isEmpty () const [virtual]

Returns TRUE because a spacer item never contains widgets.

Reimplemented from QLayoutItem.

QSize QSpacerItem::maximumSize () const [virtual]

Returns the maximum size of this spacer item.

Reimplemented from QLayoutItem.

QSize QSpacerItem::minimumSize () const [virtual]

Returns the minimum size of this spacer item.

Reimplemented from QLayoutItem.

void QSpacerItem::setGeometry ( constQRect&r ) [virtual]

Stores the spacer item's rect r so that it can be returned by geometry().

Reimplemented from QLayoutItem.

QSize QSpacerItem::sizeHint () const [virtual]

Returns the preferred size of this spacer item.

Reimplemented from QLayoutItem.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文