资源简介


资源截图

代码片段和文件信息

#include “humi.h“

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include “temp.h“

Humi::Humi(QWidget *parent) : QWidget(parent)
{

    m_chart = new QChart();

    QSplineSeries *series = new QSplineSeries(); //实例化曲线对象
    //series->setColor(QColor(0100255));
    series->setPen(QPen(QColor(0100255)2));
    series->append( QPointF(0a) );
    series->append( QPointF(1qrand()%100) );
    series->append( QPointF(2qrand()%100) );
    series->append( QPointF(3qrand()%100) );
    series->append( QPointF(4qrand()%100) );
    series->append( QPointF(5qrand()%100) );
    series->append( QPointF(6qrand()%100) );
    series->append( QPointF(7qrand()%100) );
    series->append( QPointF(8qrand()%100) );
    series->append( QPointF(9qrand()%100) );
    series->append( QPointF(10qrand()%100) );
    series->append( QPointF(11qrand()%100) );

//    series->append( QPointF(12a) );
//    series->append( QPointF(13qrand()%100) );
//    series->append( QPointF(14qrand()%100) );
//    series->append( QPointF(15qrand()%100) );
//    series->append( QPointF(16qrand()%100) );
//    series->append( QPointF(17qrand()%100) );
//    series->append( QPointF(18qrand()%100) );
//    series->append( QPointF(19qrand()%100) );
//    series->append( QPointF(20qrand()%100) );
//    series->append( QPointF(21qrand()%100) );
//    series->append( QPointF(22qrand()%100) );
//    series->append( QPointF(23qrand()%100) );

    //series->setVisible(true); //???
    //series->setPointLabelsFormat(“@xPoint@yPoint“); //???
    //series->setPointLabelsVisible(true); //???

    m_chart->setTheme(QChart::ChartThemeDark); //QChart主题
    m_chart->setDropShadowEnabled(true); //背景阴影
    m_chart->setAutoFillBackground(true); //背景自动填充

    m_chart->addSeries(series); //将曲线添加到QChart上

    m_chart->settitleBrush(QBrush(QColor(505050))); //设置标题画刷
    m_chart->settitleFont(QFont(“宋体“));
    m_chart->settitle(“湿度曲线“);

    //创建X、Y轴
    QValueAxis *axisX = new QValueAxis;
    axisX->setRange(023); //设置X轴范围,默认则坐标为动态计算大小
    axisX->setLabelFormat(“%d“); //设置格式,单位是S
    axisX->setTickCount(24); //刻度线

    QValueAxis *axisY = new QValueAxis;
    axisY->setRange(0100);
    axisY->setLabelFormat(“%d%“); //设置格式,单位是S
    QFont font(“黑体“12);
    font.setItalic(true); //斜体
    axisY->settitleFont(font);
    axisY->settitleText(“湿度值(单位%RH)“);

    m_chart->setAxisX(axisXseries);
    m_chart->setAxisY(axisYseries);
    //m_chart->createDefaultAxes();   //创建默认轴

    //修改说明样式
    m_chart->legend()->setVisible(false); //标题说明不可视
    //m_chart->legend()->setAlignment(Qt::AlignBottom); //设置底部对齐
    //m_chart->legend()->setBackgroundVisible(true); //设置背景是否可视
    //m_chart->legend()->setAutoFillBackground(true); //设置背景自动填充
    //m_chart->legend()->setColor(QColor

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.      1023  2020-04-27 14:52  TemAndHum_sys\Debug\.qmake.stash

     文件     496244  2020-05-13 13:22  TemAndHum_sys\Debug\debug\humi.o

     文件     579050  2020-05-08 22:36  TemAndHum_sys\Debug\debug\main.o

     文件       3335  2020-05-08 22:36  TemAndHum_sys\Debug\debug\moc_humi.cpp

     文件     339977  2020-05-08 22:36  TemAndHum_sys\Debug\debug\moc_humi.o

     文件       9895  2020-05-08 15:09  TemAndHum_sys\Debug\debug\moc_predefs.h

     文件       3332  2020-05-08 20:25  TemAndHum_sys\Debug\debug\moc_temp.cpp

     文件     344785  2020-05-08 20:25  TemAndHum_sys\Debug\debug\moc_temp.o

     文件       2589  2020-05-08 15:09  TemAndHum_sys\Debug\debug\moc_test.cpp

     文件     311484  2020-05-08 15:09  TemAndHum_sys\Debug\debug\moc_test.o

     文件       4940  2020-05-08 22:36  TemAndHum_sys\Debug\debug\moc_widget.cpp

     文件     385719  2020-05-08 22:36  TemAndHum_sys\Debug\debug\moc_widget.o

     文件    3293061  2020-05-13 13:22  TemAndHum_sys\Debug\debug\TemAndHum_sys.exe

     文件     823680  2020-05-08 22:36  TemAndHum_sys\Debug\debug\temp.o

     文件     583704  2020-05-08 15:10  TemAndHum_sys\Debug\debug\test.o

     文件     680986  2020-05-12 11:34  TemAndHum_sys\Debug\debug\widget.o

     文件      28562  2020-05-08 17:18  TemAndHum_sys\Debug\Makefile

     文件      97911  2020-05-08 17:18  TemAndHum_sys\Debug\Makefile.Debug

     文件      98057  2020-05-08 17:18  TemAndHum_sys\Debug\Makefile.Release

     文件       4698  2020-05-13 13:22  TemAndHum_sys\humi.cpp

     文件        565  2020-05-08 22:34  TemAndHum_sys\humi.h

     文件        622  2020-05-08 20:38  TemAndHum_sys\main.cpp

     文件       1155  2020-09-18 09:44  TemAndHum_sys\TemAndHum_sys.pro

     文件      22773  2020-11-09 20:33  TemAndHum_sys\TemAndHum_sys.pro.user

     文件      22573  2020-09-17 20:20  TemAndHum_sys\TemAndHum_sys.pro.user.0252fe0.22

     文件      43041  2020-09-19 13:30  TemAndHum_sys\TemAndHum_sys.pro.user.3e2c4c7.4.8-pre1

     文件       6438  2020-05-08 20:24  TemAndHum_sys\temp.cpp

     文件        644  2020-05-08 20:25  TemAndHum_sys\temp.h

     文件      11027  2020-05-12 11:34  TemAndHum_sys\widget.cpp

     文件       1254  2020-05-08 17:20  TemAndHum_sys\widget.h

............此处省略7个文件信息

评论

共有 条评论