DtkWidget 5.6.0.2
DTK Widget module
|
一个美观的可展开的控件. 更多...
信号 | |
void | expandChange (bool e) |
内容控件可见性发生改变的信号 e 为 true 表示内容控件变为了可见,反之则反 | |
void | sizeChanged (QSize s) |
Public 成员函数 | |
DBaseExpand (QWidget *parent=nullptr) | |
获取 DBaseExpand::DBaseExpand 实例 parent 作为实例的父控件 | |
void | setHeader (QWidget *header) |
设置标题控件 标题控件会始终显示在布局里 header 标题控件 | |
void | setContent (QWidget *content, Qt::Alignment alignment=Qt::AlignHCenter) |
设置内容控件 内容控件默认是隐藏的,调用 DBaseExpand::setExpand 设置其可见性 content 内容控件 alignment 内容控件在布局中的对齐方式 | |
QWidget * | getContent () const |
获取内容控件对象 更多... | |
void | setHeaderHeight (int height) |
设置标题控件的高度 更多... | |
virtual void | setExpand (bool value) |
设置内容控件的可见性 更多... | |
bool | expand () const |
获取当前内容控件的可见性 更多... | |
void | setAnimationDuration (int duration) |
设置内容控件的可见性改变时动画的时间 更多... | |
void | setAnimationEasingCurve (QEasingCurve curve) |
设置内容控件的可见性改变时动画的样式 更多... | |
void | setSeparatorVisible (bool arg) |
设置是否允许标题控件与内容控件之间的分割线 更多... | |
void | setExpandedSeparatorVisible (bool arg) |
设置是否允许内容控件下的分割线 更多... | |
Protected 成员函数 | |
void | resizeEvent (QResizeEvent *e) Q_DECL_OVERRIDE |
一个美观的可展开的控件.
\inmodule dtkwidget
使用 DBaseExpand 类可以创建一个可展开的带有展开动画效果的控件,这个控件包含上下两部分,上面的控件为标题控件,这个控件会始终显示,下面的控件为内容控件,默认为不会显示,调用 DBaseExpand::setExpand 设置内容控件的可见性。使用 DBaseExpand::setHeader 和 DBaseExpand::setContent 设置分别设置标题控件和内容控件。
bool Dtk::Widget::DBaseExpand::expand | ( | ) | const |
获取当前内容控件的可见性
QWidget * Dtk::Widget::DBaseExpand::getContent | ( | ) | const |
获取内容控件对象
void Dtk::Widget::DBaseExpand::setAnimationDuration | ( | int | duration | ) |
设置内容控件的可见性改变时动画的时间
duration 指定动画时间
void Dtk::Widget::DBaseExpand::setAnimationEasingCurve | ( | QEasingCurve | curve | ) |
设置内容控件的可见性改变时动画的样式
curve 指定动画样式
|
virtual |
设置内容控件的可见性
value 为 true 则内容控件可见,反之则反
被 Dtk::Widget::DArrowLineExpand , 以及 Dtk::Widget::DSwitchLineExpand 重载.
void Dtk::Widget::DBaseExpand::setExpandedSeparatorVisible | ( | bool | arg | ) |
设置是否允许内容控件下的分割线
arg 为 ture 则显示分割线,反之则反
void Dtk::Widget::DBaseExpand::setHeaderHeight | ( | int | height | ) |
设置标题控件的高度
height 指定的高度
void Dtk::Widget::DBaseExpand::setSeparatorVisible | ( | bool | arg | ) |
设置是否允许标题控件与内容控件之间的分割线
arg 为 ture 则显示分割线,反之则反