返回介绍

QHBoxLayout Class

发布于 2019-10-04 15:00:36 字数 2733 浏览 1146 评论 0 收藏 0

The QHBoxLayout class lines up widgets horizontally. More...

#include <qlayout.h>

Inherits QBoxLayout.

List of all member functions.

Public Members

  • QHBoxLayout ( QWidget*parent, intmargin = 0, intspacing = -1, constchar*name = 0 )
  • QHBoxLayout ( QLayout*parentLayout, intspacing = -1, constchar*name = 0 )
  • QHBoxLayout ( intspacing = -1, constchar*name = 0 )
  • ~QHBoxLayout ()

Detailed Description

The QHBoxLayout class lines up widgets horizontally.

This class is used to construct horizontal box layout objects. See QBoxLayout for more details.

The simplest use of the class is like this:

        QBoxLayout * l = new QHBoxLayout( widget );
        l->setAutoAdd( TRUE );
        new QSomeWidget( widget );
        new QSomeOtherWidget( widget );
        new QAnotherWidget( widget );
    

or like this:

        QBoxLayout * l = new QHBoxLayout( widget );
        l->addWidget( existingChildOfWidget );
        l->addWidget( anotherChildOfWidget );
    

QHBox

See also QVBoxLayout, QGridLayout, the Layout overview, Widget Appearance and Style and Layout Management.


Member Function Documentation

QHBoxLayout::QHBoxLayout ( QWidget*parent, intmargin = 0, intspacing = -1, constchar*name = 0 )

Constructs a new top-level horizontal box called name, with parent parent.

The margin is the number of pixels between the edge of the widget and its managed children. The spacing is the default number of pixels between neighboring children. If spacing is -1 the value of margin is used for spacing.

QHBoxLayout::QHBoxLayout ( QLayout*parentLayout, intspacing = -1, constchar*name = 0 )

Constructs a new horizontal box called name name and adds it to parentLayout.

The spacing is the default number of pixels between neighboring children. If spacing is -1, this QHBoxLayout will inherit its parent's spacing().

QHBoxLayout::QHBoxLayout ( intspacing = -1, constchar*name = 0 )

Constructs a new horizontal box called name name. You must add it to another layout.

The spacing is the default number of pixels between neighboring children. If spacing is -1, this QHBoxLayout will inherit its parent's spacing().

QHBoxLayout::~QHBoxLayout ()

Destroys this box layout.

The layout's widgets are not destroyed.

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

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

发布评论

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