DtkWidget 5.6.0.2
DTK Widget module
|
DSegmentedControl 类提供了一种类似标签页的控件. 更多...
Public 槽 | |
int | addSegmented (const QString &title) |
DSegmentedControl::addSegmented 为控件添加 Segment,并指定标题。 title 为 Segment 的标题。 更多... | |
int | addSegmented (const QIcon &icon, const QString &title) |
DSegmentedControl::addSegmented 为控件添加 Segment,并指定标题和图标。 icon 为 Segment 的图标。 title 为 Segment 的标题。 更多... | |
void | addSegmented (const QStringList &titleList) |
DSegmentedControl::addSegmented 添加多个 Segment。 titleList 多个 Segment 的标题列表。 更多... | |
void | addSegmented (const QList< QIcon > &iconList, const QStringList &titleList) |
DSegmentedControl::addSegmented 添加多个 Segment。 titleList 为多个 Segment 的标题列表。 iconList 为多个 Segment 的图标列表。 更多... | |
void | insertSegmented (int index, const QString &title) |
DSegmentedControl::insertSegmented 用于在特定位置插入一个新的 Segment。 index 指定要插入 Segment 的位置。 title 指定要插入 Segment 的标题。 更多... | |
void | insertSegmented (int index, const QIcon &icon, const QString &title) |
DSegmentedControl::insertSegmented 用于在特定位置插入一个新的 Segment。 index 指定要插入 Segment 的位置。 title 指定要插入 Segment 的标题。 更多... | |
void | removeSegmented (int index) |
DSegmentedControl::removeSegmented 用于移除特定位置上的 Segment。 index 指定了要移除的 Segment 的索引。 | |
void | clear () |
DSegmentedControl::clear 清除所有 Segment 。 | |
bool | setCurrentIndex (int currentIndex) |
bool | setCurrentIndexByTitle (const QString &title) |
DSegmentedControl::setCurrentIndexByTitle 设置标题为指定标题的 Segment 为当前选中(高亮)的 Segment。 title 为指定的标题。 更多... | |
void | setText (int index, const QString &title) |
DSegmentedControl::setText 用于给特定位置的 Segment 设置标题。 index 为指定 Segment 的索引。 title 为要设定的标题内容。 | |
void | setIcon (int index, const QIcon &icon) |
DSegmentedControl::setIcon 用于给特定位置的 Segment 设置图标。 index 为指定 Segment 的索引。 icon 为要设定的图标。 | |
void | setAnimationDuration (int animationDuration) |
void | setAnimationType (QEasingCurve::Type animationType) |
信号 | |
void | currentChanged (int index) |
信号在当前选中(高亮)的 Segment 发生改变时触发. 更多... | |
void | currentTitleChanged (QString title) |
信号在当前选中(高亮)的 Segment 发生改变时触发. 更多... | |
void | animationDurationChanged (int animationDuration) |
信号在高亮动画的动画周期发生改变时触发. 更多... | |
Public 成员函数 | |
DSegmentedControl (QWidget *parent=0) | |
DSegmentedControl::DSegmentedControl 为 DSegmentedControl 类的构造函数。 parent 制定了控件的父控件。 | |
int | count () const |
const DSegmentedHighlight * | highlight () const |
DSegmentedControl::highlight 用于获取当前选中(高亮)的 Segment 。 更多... | |
int | currentIndex () const |
QToolButton * | at (int index) const |
DSegmentedControl::at 用于获取在特定位置上的 Segment。 Segment 目前由 QToolButton 充当。 index 为所要获取的 Segment 的索引。 更多... | |
QString | getText (int index) const |
DSegmentedControl::getText 用于获取在特定位置上 Segment 的标题。 index 为所要获取的 Segment 的索引。 更多... | |
QIcon | getIcon (int index) const |
DSegmentedControl::getIcon 用于获取在特定位置上 Segment 的图标。 index 为所要获取的 Segment 的索引。 更多... | |
int | animationDuration () const |
int | indexByTitle (const QString &title) const |
DSegmentedControl::indexByTitle 用于通过 Segment 的标题内容获取 Segment 的索引。 title 指定 Segment 的标题内容。 更多... | |
QEasingCurve::Type | animationType () const |
Protected 成员函数 | |
bool | eventFilter (QObject *, QEvent *) override |
void | resizeEvent (QResizeEvent *event) override |
属性 | |
int | currentIndex |
currentIndex 属性指示当前选中 Segment 在所有 Segment 中的位置。 | |
int | count |
count 属性代表了控件中 Segment 的数量。 | |
int | animationDuration |
animationDuration 属性用于控制控件中高亮部分移动动画的时间周期。 | |
QEasingCurve::Type | animationType |
animationType 属性用于控制控件中高亮部分移动动画的动画曲线类型。 | |
DSegmentedControl 类提供了一种类似标签页的控件.
\inmodule dtkwidget
它由一系列的 Segment 构成,每一个 Segment 可以被设置标题和图标,也可以被选中, 它们之间的选中为互斥关系。 DSegmentedControl 更像是脱离于 QTabWidget 工作的 QTabBar 。
它可以跟 QStackedLayout 搭配使用,达到切换标签页的功能,例如:
|
slot |
DSegmentedControl::addSegmented 为控件添加 Segment,并指定标题和图标。 icon 为 Segment 的图标。 title 为 Segment 的标题。
|
slot |
DSegmentedControl::addSegmented 添加多个 Segment。 titleList 为多个 Segment 的标题列表。 iconList 为多个 Segment 的图标列表。
|
slot |
DSegmentedControl::addSegmented 为控件添加 Segment,并指定标题。 title 为 Segment 的标题。
|
slot |
DSegmentedControl::addSegmented 添加多个 Segment。 titleList 多个 Segment 的标题列表。
|
signal |
信号在高亮动画的动画周期发生改变时触发.
animationDuration 改变的动画周期.
QToolButton * Dtk::Widget::DSegmentedControl::at | ( | int | index | ) | const |
DSegmentedControl::at 用于获取在特定位置上的 Segment。 Segment 目前由 QToolButton 充当。 index 为所要获取的 Segment 的索引。
|
signal |
信号在当前选中(高亮)的 Segment 发生改变时触发.
index 当前标签的索引.
|
signal |
信号在当前选中(高亮)的 Segment 发生改变时触发.
title 改变的标签标题.
QIcon Dtk::Widget::DSegmentedControl::getIcon | ( | int | index | ) | const |
DSegmentedControl::getIcon 用于获取在特定位置上 Segment 的图标。 index 为所要获取的 Segment 的索引。
QString Dtk::Widget::DSegmentedControl::getText | ( | int | index | ) | const |
DSegmentedControl::getText 用于获取在特定位置上 Segment 的标题。 index 为所要获取的 Segment 的索引。
const DSegmentedHighlight * Dtk::Widget::DSegmentedControl::highlight | ( | ) | const |
DSegmentedControl::highlight 用于获取当前选中(高亮)的 Segment 。
int Dtk::Widget::DSegmentedControl::indexByTitle | ( | const QString & | title | ) | const |
DSegmentedControl::indexByTitle 用于通过 Segment 的标题内容获取 Segment 的索引。 title 指定 Segment 的标题内容。
|
slot |
DSegmentedControl::insertSegmented 用于在特定位置插入一个新的 Segment。 index 指定要插入 Segment 的位置。 title 指定要插入 Segment 的标题。
|
slot |
DSegmentedControl::insertSegmented 用于在特定位置插入一个新的 Segment。 index 指定要插入 Segment 的位置。 title 指定要插入 Segment 的标题。
|
slot |
DSegmentedControl::setCurrentIndexByTitle 设置标题为指定标题的 Segment 为当前选中(高亮)的 Segment。 title 为指定的标题。