QtExamples/QtQdialQLCDEx/ExQdialQLCD.cpp
touwoyimuli@gmail.com c66ea918b0 update
2019-08-22 23:21:49 +08:00

45 lines
1012 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "ExQdialQLCD.h"
#include "ui_ExQdialQLCD.h"
ExQdialQLCD::ExQdialQLCD(QWidget *parent) :
QWidget(parent),
ui(new Ui::ExQdialQLCD)
{
ui->setupUi(this);
//notchesVisible:表盘的小刻度是否可见
//notchTarget表盘刻度间间隔的像素值
connect(ui->dial, SIGNAL(valueChanged(int)), this, SLOT(onDisplayLCD(int)));
setWindowTitle(QObject::tr("QDial表盘输入在LCD以多种进制显示"));
}
ExQdialQLCD::~ExQdialQLCD()
{
delete ui;
}
void ExQdialQLCD::onDisplayLCD(int val)
{
ui->lcdNumber->display(val);
}
void ExQdialQLCD::on_raidBtn2_clicked() //设置LCD显示二进制数
{
ui->lcdNumber->setBinMode();
}
void ExQdialQLCD::on_raidBtn8_clicked() //设置LCD显示八进制数
{
ui->lcdNumber->setOctMode();
}
void ExQdialQLCD::on_raidBtn10_clicked() //设置LCD显示十进制数
{
ui->lcdNumber->setDecMode();
}
void ExQdialQLCD::on_raidBtn16_clicked() //设置LCD显示十六进制数
{
ui->lcdNumber->setHexMode();
}