DtkWidget 5.6.0.2
DTK Widget module
|
The DBoxWidget class provides widget born with QBoxLayout set. 更多...
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.
|
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.
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.
|
protected |
\reimp
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.
|
slot |
设置QBoxLayout当前的方向
direction
QSize Dtk::Widget::DBoxWidget::sizeHint | ( | ) | const |
DBoxWidget::sizeHint reimplemented from QWidget::sizeHint().
\reimp
|
readwrite |
This property holds the direction of the internal QBoxLayout.
这个属性返回当前QBoxLayout使用的方向