|
DtkWidget
DTK Widget module
|
DFlowLayout 类提供了一个简便的流布局. 更多...
Public 类型 | |
| typedef QListView::Flow | Flow |
Public 槽 | |
| void | setHorizontalSpacing (int horizontalSpacing) |
| 设置纵横横向的元素疏密度(Spacing). | |
| void | setVerticalSpacing (int verticalSpacing) |
| 设置纵横纵向的元素疏密度(Spacing) | |
| void | setSpacing (int spacing) |
| 设置纵横两个方向的元素疏密度(Spacing) | |
| void | setFlow (Flow flow) |
| 设置布局方向 | |
Public 成员函数 | |
| DFlowLayout (QWidget *parent) | |
| void | insertItem (int index, QLayoutItem *item) |
| 向布局中插入一个 QLayoutItem. | |
| void | insertWidget (int index, QWidget *widget) |
| 向布局中插入一个 QWidget. | |
| void | insertLayout (int index, QLayout *layout) |
| 向布局中插入一个 QLayout 子布局. | |
| void | insertSpacing (int index, int size) |
| 向布局中插入一个指定大小的占位符(QSpacerItem). | |
| void | insertStretch (int index, int stretch=0) |
| 向布局中插入一个扩充大小的占位符(QSpacerItem). | |
| void | insertSpacerItem (int index, QSpacerItem *spacerItem) |
| 向布局中插入一个占位符(QSpacerItem). | |
| void | addSpacing (int size) |
| 向布局中追加一个固定大小的占位符(QSpacerItem). | |
| void | addStretch (int stretch=0) |
| 向布局中追加一个扩充大小的占位符(QSpacerItem). | |
| void | addSpacerItem (QSpacerItem *spacerItem) |
| 向布局中追加一个的占位符(QSpacerItem). | |
| void | addItem (QLayoutItem *item) Q_DECL_OVERRIDE |
| 向布局中追加一个 QLayoutItem. | |
| bool | hasHeightForWidth () const Q_DECL_OVERRIDE |
| 是否可以有固定高度. | |
| int | heightForWidth (int) const Q_DECL_OVERRIDE |
| 根据指定宽度获得对应高度. | |
| int | count () const Q_DECL_OVERRIDE |
| 布局内的元素数量. | |
| QLayoutItem * | itemAt (int index) const Q_DECL_OVERRIDE |
| QSize | minimumSize () const Q_DECL_OVERRIDE |
| void | setGeometry (const QRect &rect) Q_DECL_OVERRIDE |
| QSize | sizeHint () const Q_DECL_OVERRIDE |
| QLayoutItem * | takeAt (int index) Q_DECL_OVERRIDE |
| 移除并取得 index 位置的对应元素. | |
| Qt::Orientations | expandingDirections () const Q_DECL_OVERRIDE |
| int | horizontalSpacing () const |
| 取得横横横向的元素疏密度(Spacing). | |
| int | verticalSpacing () const |
| 取得纵横横向的元素疏密度(Spacing). | |
| Flow | flow () const |
| 取得流布局的方向 | |
属性 | |
| int | horizontalSpacing |
| int | verticalSpacing |
| int | count |
| Flow | flow |
| QSize | sizeHint |
DFlowLayout 类提供了一个简便的流布局.
\inmodule dtkwidget
The DFlowLayout class provides a flow list layout.
上方图片是一个 DFlowLayout 的典型应用场景。注意示例图中的标题文本并不是 DFlowLayout 的一部分。 The above image is a classic use case of DFlowLayout. Notably the title text label in the example is not a part of DFlowLayout.
| void Dtk::Widget::DFlowLayout::addItem | ( | QLayoutItem * | item | ) |
向布局中追加一个 QLayoutItem.
Insert a QLayoutItem to layout.
item 待插入的 QLayoutItem item to be insert.
| void Dtk::Widget::DFlowLayout::addSpacerItem | ( | QSpacerItem * | spacerItem | ) |
向布局中追加一个的占位符(QSpacerItem).
Insert a QSpacerItem to layout.
spacerItem 待插入的 QSpacerItem spacerItem to be insert.
| void Dtk::Widget::DFlowLayout::addSpacing | ( | int | size | ) |
向布局中追加一个固定大小的占位符(QSpacerItem).
Insert a fixed size QSpacerItem to layout.
size 占位符大小 size of the QSpacerItem to be insert
| void Dtk::Widget::DFlowLayout::addStretch | ( | int | stretch = 0 | ) |
向布局中追加一个扩充大小的占位符(QSpacerItem).
Insert a expanding QSpacerItem to layout.
stretch 没有作用的参数 stretch Unused argument.
| int Dtk::Widget::DFlowLayout::count | ( | ) | const |
布局内的元素数量.
item count in layout.
| DFlowLayout::Flow Dtk::Widget::DFlowLayout::flow | ( | ) | const |
| bool Dtk::Widget::DFlowLayout::hasHeightForWidth | ( | ) | const |
是否可以有固定高度.
check if layout can have a fixed height.
| int Dtk::Widget::DFlowLayout::heightForWidth | ( | int | width | ) | const |
| int Dtk::Widget::DFlowLayout::horizontalSpacing | ( | ) | const |
取得横横横向的元素疏密度(Spacing).
get flow spacing in horizontal direction.
| void Dtk::Widget::DFlowLayout::insertItem | ( | int | index, |
| QLayoutItem * | item | ||
| ) |
向布局中插入一个 QLayoutItem.
Insert item to layout.
index 插入到的位置 item 待插入的 QLayoutItem
index to be insert item the QLayoutItem to be insert
| void Dtk::Widget::DFlowLayout::insertLayout | ( | int | index, |
| QLayout * | layout | ||
| ) |
向布局中插入一个 QLayout 子布局.
Insert a sub-layout to layout.
index 插入到的位置 layout 待插入的 QLayout
index to be insert layout the QLayout to be insert
| void Dtk::Widget::DFlowLayout::insertSpacerItem | ( | int | index, |
| QSpacerItem * | spacerItem | ||
| ) |
向布局中插入一个占位符(QSpacerItem).
Insert a fixed size QSpacer to layout.
index 插入到的位置 spacerItem 待插入的 QSpacerItem
index to be insert spacerItem to be insert
| void Dtk::Widget::DFlowLayout::insertSpacing | ( | int | index, |
| int | size | ||
| ) |
向布局中插入一个指定大小的占位符(QSpacerItem).
Insert a fixed size QSpacerItem to layout.
index 插入到的位置 size 待插入的 QSpacerItem 的大小
index to be insert size of the QSpacerItem to be insert
| void Dtk::Widget::DFlowLayout::insertStretch | ( | int | index, |
| int | stretch = 0 |
||
| ) |
向布局中插入一个扩充大小的占位符(QSpacerItem).
Insert a expanding QSpacerItem to layout.
index 插入到的位置 stretch 没有作用的参数
index to be insert stretch Unused argument
| void Dtk::Widget::DFlowLayout::insertWidget | ( | int | index, |
| QWidget * | widget | ||
| ) |
向布局中插入一个 QWidget.
Insert widget to layout.
index 插入到的位置 widget 待插入的 QWidget
index to be insert widget the QWidget to be insert
|
slot |
设置布局方向
set flow direction
|
slot |
设置纵横横向的元素疏密度(Spacing).
set flow spacing in horizontal direction.
horizontalSpacing 水平间距值
|
slot |
设置纵横两个方向的元素疏密度(Spacing)
set flow spacing in horizontal and vertical direction.
spacing 两个方向的间距值.
|
slot |
设置纵横纵向的元素疏密度(Spacing)
set flow verticalSpacing in vertical direction.
verticalSpacing 竖直方向的间距值.
| QLayoutItem * Dtk::Widget::DFlowLayout::takeAt | ( | int | index | ) |
移除并取得 index 位置的对应元素.
take the QLayoutItem at the given index.
| int Dtk::Widget::DFlowLayout::verticalSpacing | ( | ) | const |
取得纵横横向的元素疏密度(Spacing).
get flow spacing in vertical direction.