DtkWidget 5.6.0.2
DTK Widget module
Public 槽 | 信号 | Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
Dtk::Widget::DBoxWidget类 参考

The DBoxWidget class provides widget born with QBoxLayout set. 更多...

类 Dtk::Widget::DBoxWidget 继承关系图:
Inheritance graph
[图例]
Dtk::Widget::DBoxWidget 的协作图:
Collaboration graph
[图例]

Public 槽

void setDirection (QBoxLayout::Direction direction)
 设置QBoxLayout当前的方向 更多...
 

信号

void sizeChanged (QSize size)
 
void directionChanged (QBoxLayout::Direction direction)
 

Public 成员函数

 DBoxWidget (QBoxLayout::Direction direction, QWidget *parent=0)
 DBoxWidget的构造函数. 更多...
 
QBoxLayout::Direction direction () const
 
QBoxLayout * layout () const
 这个属性会返回当前使用的布局对象 更多...
 
void addWidget (QWidget *widget)
 调用QBoxLayout的addWidget方法将QWidget添加到布局中 更多...
 
QSize sizeHint () const Q_DECL_OVERRIDE
 DBoxWidget::sizeHint reimplemented from QWidget::sizeHint(). 更多...
 

Protected 成员函数

virtual void updateSize (const QSize &size)
 当方向是QBoxLayout::TopToBottom或者QBoxLayout::BottomToTop时, 固定高度将使用传入的高度,并设置最小宽度为传入的宽度。 否则将使用传入的宽度当做固定宽度,高度为最小高度。 size
 
bool event (QEvent *ee) Q_DECL_OVERRIDE
 

属性

QBoxLayout::Direction direction
 This property holds the direction of the internal QBoxLayout. 更多...
 

详细描述

The DBoxWidget class provides widget born with QBoxLayout set.

\inmodule dtkwidget

DBoxWidget提供了一个自适应子控件大小的Widget.

在Qt编程中,使用QBoxLayout设置控件是很常见的,DBoxWidget提供了方便的封装,会根据需要的大小自动 设置DBoxWidget的宽高。

Since an widget with QBoxLayout set is very common use case in Qt programming, yet very tedious, DBoxWidget is built to ease that pain.

Also, DBoxWidget will calculate the size it needs automatically, so you don't need to set width for DHBoxWidget or height for DVBoxLayout.

参见
DHBoxWidget and DVBoxWidget

构造及析构函数说明

◆ DBoxWidget()

Dtk::Widget::DBoxWidget::DBoxWidget ( QBoxLayout::Direction  direction,
QWidget *  parent = 0 
)
explicit

DBoxWidget的构造函数.

DBoxWidget::DBoxWidget constructs an instance of DBoxWidget.

direction 是设置内部QBoxLayout使用的方向 parent 传递给QFrame的构造函数 direction is the direction used by the internal QBoxLayout. parent is passed to QFrame constructor.

成员函数说明

◆ addWidget()

void Dtk::Widget::DBoxWidget::addWidget ( QWidget *  widget)

调用QBoxLayout的addWidget方法将QWidget添加到布局中

DBoxWidget::addWidget adds widget to the internal layout.

widget 要添加的QWidget对象 widget is the widget to be added.

◆ event()

bool Dtk::Widget::DBoxWidget::event ( QEvent ee)
protected

\reimp

◆ layout()

QBoxLayout * Dtk::Widget::DBoxWidget::layout ( ) const

这个属性会返回当前使用的布局对象

This property holds the internal layout object.

This property can be used to get the internal layout, so you can set some extra properties on the layout to match the custom needs.

返回
QBoxLayout*

◆ setDirection

void Dtk::Widget::DBoxWidget::setDirection ( QBoxLayout::Direction  direction)
slot

设置QBoxLayout当前的方向

direction

◆ sizeHint()

QSize Dtk::Widget::DBoxWidget::sizeHint ( ) const

DBoxWidget::sizeHint reimplemented from QWidget::sizeHint().

\reimp

返回
the recommended size of this widget.

属性说明

◆ direction

Dtk::Widget::DBoxWidget::direction
readwrite

This property holds the direction of the internal QBoxLayout.

这个属性返回当前QBoxLayout使用的方向

返回
QBoxLayout::Direction 当前的方向

该类的文档由以下文件生成: