DtkWidget 5.6.0.2
DTK Widget module
|
Deepin风格的QSpinBox. 更多...
Public 槽 | |
void | setAlert (bool alert) |
D_DECL_DEPRECATED void | setDefaultValue (int defaultValue) |
信号 | |
void | alertChanged (bool alert) |
警告状态发生了变化. 更多... | |
D_DECL_DEPRECATED void | defaultValueChanged (int defaultValue) |
默认值发生了变化. 更多... | |
Public 成员函数 | |
DSpinBox (QWidget *parent=nullptr) | |
构造一个 DSpinBox 实例。 更多... | |
QLineEdit * | lineEdit () const |
获取输入框控件。 更多... | |
bool | isAlert () const |
表示当前控件是否处于警告状态的属性. 更多... | |
void | showAlertMessage (const QString &text, int duration=3000) |
显示指定的文本消息,超过指定时间后警告消息消失. 更多... | |
void | showAlertMessage (const QString &text, QWidget *follower, int duration=3000) |
显示指定的文本消息,超过指定时间后警告消息消失. 更多... | |
D_DECL_DEPRECATED int | defaultValue () const |
这个属性的值是控件的默认值。 更多... | |
void | setEnabledEmbedStyle (bool enabled) |
属性 | |
bool | alert |
This property holds whether the widget on alert mode. | |
int | defaultValue |
Deepin风格的QSpinBox.
\inmodule dtkwidget
The DSpinBox class provides deepin style QSpinBox.
类似 DLineEdit ,这个控件也提供了警告功能,用于提醒用户当前输入的数据不正确,另外,还可以设置一个默认的值,并在默认值发生改变时发出信号。 如下图上面的是正常状态的控件, 下面的是处于警告状态的控件: Like DLineEdit, this widget can be set on alert to warn the user that the input is not correct. In addition, there's a DSpinBox::defaultValue property can be used to set a default value on the widget.
|
explicit |
构造一个 DSpinBox 实例。
DSpinBox::DSpinBox constructs an instance of DSpinBox
parent 作为该实例的父控件。 parent is passed to QSpinBox constructor
|
signal |
警告状态发生了变化.
alert 当前的警告状态。
int Dtk::Widget::DSpinBox::defaultValue | ( | ) | const |
这个属性的值是控件的默认值。
使用 DSpinBox::defaultValue 获取默认值,使用 DSpinBox::setDefaultValue 设置默认值, 点击控件上的 reset 按钮会设置为此值。
|
signal |
默认值发生了变化.
defaultValue 控件的默认值。
bool Dtk::Widget::DSpinBox::isAlert | ( | ) | const |
表示当前控件是否处于警告状态的属性.
使用 DSpinBox::isAlert 获取属性当前状态,使用 DSpinBox::setAlert 设置属性的状态。
QLineEdit * Dtk::Widget::DSpinBox::lineEdit | ( | ) | const |
获取输入框控件。
void Dtk::Widget::DSpinBox::showAlertMessage | ( | const QString & | text, |
int | duration = 3000 |
||
) |
显示指定的文本消息,超过指定时间后警告消息消失.
text text警告的文本 duration 显示的时间长度,单位毫秒
void Dtk::Widget::DSpinBox::showAlertMessage | ( | const QString & | text, |
QWidget * | follower, | ||
int | duration = 3000 |
||
) |
显示指定的文本消息,超过指定时间后警告消息消失.
text text警告的文本 follower 指定文本消息跟随的对象 duration 显示的时间长度,单位毫秒