QT学习之QLCDNumber类

The QLCDNumber widget displays a number with LCD-like digits.

It can display a number in just about any size. It can display decimal, hexadecimal, octal or binary numbers. It is easy to connect to data sources using the display() slot, which is overloaded to take any of five argument types.

其实与QLabel类差不多,都是显示数字文本字符串等信息。

主要函数功能如下:

1 显示和设置数字位数:int digitCount() const: void setDigitCount(int numDigis)

2 显示和设置小数点:bool smallDecimalPoint() void setSmallDecimalPoint(bool) 当bool位真时,小数点在两个数之间,当位false时,小数点占一个数据位。

3 显示和设置模式:我们可以设置十进制, 十六进制,8进制,2进制格式, Mode mode() const; void setMode(Mode)

4 显示和设置控件风格, enum QLCDNumber:SegmentStyle { Outline, Filled, Flat}  

SegmentStyle segmentSyle() const; void setSegmentStyle(SegmentStyle)

5 显示数字字符函数: void display(const QStirng &s) ; void display(int );void display(double); double value()

6 显示是否溢出, bool checkOverflow(int num) ;bool checkOverflow(double num)

7 信号函数: 当溢出时,会发出overflow()信号

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值