476
社区成员
发帖
与我相关
我的任务
分享
源码:
dialplot.cpp (8 K) 下载次数:308
dialplot.h (3 K) 下载次数:264 使用方法:复制代码#include "frmdialplot.h"#include "ui_frmdialplot.h"frmDialPlot::frmDialPlot(QWidget *parent) : QWidget(parent), ui(new Ui::frmDialPlot){ ui->setupUi(this); this->initForm();}frmDialPlot::~frmDialPlot(){ delete ui;}void frmDialPlot::initForm(){ int minValue = 0; int maxValue = 100; int value = minValue; ui->widget1->setUnit("km/h"); ui->widget1->setRange(minValue, maxValue); ui->widget1->setValue(value); ui->horizontalSlider1->setRange(minValue, maxValue); ui->horizontalSlider1->setValue(value); connect(ui->horizontalSlider1, SIGNAL(valueChanged(int)), ui->widget1, SLOT(setValue(int))); minValue = -50; maxValue = 150; value = minValue; ui->widget2->setTextColor(QColor(0, 0, 0)); ui->widget2->setBgColor(QColor(255, 255, 255)); ui->widget2->setFirstColor(QColor(112, 112, 112)); ui->widget2->setSecondColor(QColor(102, 205, 0)); ui->widget2->setThirdColor(QColor(135, 205, 254)); ui->widget2->setCenterColor(QColor(51, 51, 51)); ui->widget2->setUnit("℃"); ui->widget2->setRange(minValue, maxValue); ui->widget2->setValue(value); ui->horizontalSlider2->setRange(minValue, maxValue); ui->horizontalSlider2->setValue(value); connect(ui->horizontalSlider2, SIGNAL(valueChanged(int)), ui->widget2, SLOT(setValue(int)));}
很赞,
厉害厉害
,
,非常感谢,
前辈厉害!!!!!!!!!!!!!!!!!!
没有人围观吗!?
高手高手