返回介绍

QHBox Class

发布于 2019-10-04 15:00:35 字数 2450 浏览 1076 评论 0 收藏 0

The QHBox widget provides horizontal geometry management for its child widgets. More...

#include <qhbox.h>

Inherits QFrame.

Inherited by QVBox.

List of all member functions.

Public Members

  • QHBox ( QWidget*parent = 0, constchar*name = 0, WFlagsf = 0 )
  • void setSpacing ( intspace )
  • bool setStretchFactor ( QWidget*w, intstretch )

Protected Members

  • QHBox ( boolhorizontal, QWidget*parent = 0, constchar*name = 0, WFlagsf = 0 )

Detailed Description

The QHBox widget provides horizontal geometry management for its child widgets.

All the horizontal box's child widgets will be placed alongside each other and sized according to their sizeHint()s.

Use setMargin() to add space around the edge, and use setSpacing() to add space between the widgets. Use setStretchFactor() if you want the widgets to be different sizes in proportion to one another.

QHBox

See also QHBoxLayout, QVBox, QGrid, Widget Appearance and Style, Layout Management and Organizers.


Member Function Documentation

QHBox::QHBox ( QWidget*parent = 0, constchar*name = 0, WFlagsf = 0 )

Constructs an hbox widget with parent parent and name name. The parent, name and widget flags, f, are passed to the QFrame constructor.

QHBox::QHBox ( boolhorizontal, QWidget*parent = 0, constchar*name = 0, WFlagsf = 0 ) [protected]

Constructs a horizontal hbox if horizontal is TRUE, otherwise constructs a vertical hbox (also known as a vbox).

This constructor is provided for the QVBox class. You should never need to use it directly.

The parent, name and widget flags, f, are passed to the QFrame constructor.

void QHBox::setSpacing ( intspace )

Sets the spacing between the child widgets to space.

Examples: i18n/mywidget.cpp, listboxcombo/listboxcombo.cpp, network/ftpclient/ftpmainwindow.cpp, qdir/qdir.cpp, tabdialog/tabdialog.cpp, wizard/wizard.cpp and xform/xform.cpp.

bool QHBox::setStretchFactor ( QWidget*w, intstretch )

Sets the stretch factor of widget w to stretch.

See also QBoxLayout::setStretchFactor().

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

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

发布评论

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