DtkWidget 5.6.0.2
DTK Widget module
Public 槽 | 信号 | Public 成员函数 | 属性 | 所有成员列表
Dtk::Widget::DSpinBox类 参考

Deepin风格的QSpinBox. 更多...

类 Dtk::Widget::DSpinBox 继承关系图:
Inheritance graph
[图例]
Dtk::Widget::DSpinBox 的协作图:
Collaboration graph
[图例]

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.

构造及析构函数说明

◆ DSpinBox()

Dtk::Widget::DSpinBox::DSpinBox ( QWidget *  parent = nullptr)
explicit

构造一个 DSpinBox 实例。

DSpinBox::DSpinBox constructs an instance of DSpinBox

parent 作为该实例的父控件。 parent is passed to QSpinBox constructor

成员函数说明

◆ alertChanged

void Dtk::Widget::DSpinBox::alertChanged ( bool  alert)
signal

警告状态发生了变化.

alert 当前的警告状态。

◆ defaultValue()

int Dtk::Widget::DSpinBox::defaultValue ( ) const

这个属性的值是控件的默认值。

使用 DSpinBox::defaultValue 获取默认值,使用 DSpinBox::setDefaultValue 设置默认值, 点击控件上的 reset 按钮会设置为此值。

◆ defaultValueChanged

void Dtk::Widget::DSpinBox::defaultValueChanged ( int  defaultValue)
signal

默认值发生了变化.

defaultValue 控件的默认值。

◆ isAlert()

bool Dtk::Widget::DSpinBox::isAlert ( ) const

表示当前控件是否处于警告状态的属性.

使用 DSpinBox::isAlert 获取属性当前状态,使用 DSpinBox::setAlert 设置属性的状态。

返回
当前状态处于警告状态,返回 true,否则返回 false.

◆ lineEdit()

QLineEdit * Dtk::Widget::DSpinBox::lineEdit ( ) const

获取输入框控件。

返回
返回正在使用的输入库控件对象。
the QLineEdit used by this spin box.

◆ showAlertMessage() [1/2]

void Dtk::Widget::DSpinBox::showAlertMessage ( const QString text,
int  duration = 3000 
)

显示指定的文本消息,超过指定时间后警告消息消失.

text text警告的文本 duration 显示的时间长度,单位毫秒

◆ showAlertMessage() [2/2]

void Dtk::Widget::DSpinBox::showAlertMessage ( const QString text,
QWidget *  follower,
int  duration = 3000 
)

显示指定的文本消息,超过指定时间后警告消息消失.

text text警告的文本 follower 指定文本消息跟随的对象 duration 显示的时间长度,单位毫秒


该类的文档由以下文件生成: