3500/TrendGraph.cpp

47 lines
1.2 KiB
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 "TrendGraph.h"
#include "ui_TrendGraph.h"
#include <QListView>
#include "global.h"
CTrendGraph::CTrendGraph(QWidget *parent) :
QWidget(parent),
ui(new Ui::CTrendGraph)
{
ui->setupUi(this);
QDateTime curDateTime=QDateTime::currentDateTime();//通过QDateTime的currentDateTime获得当前的日期时间并赋值给curDateTime
ui->dateTimeEdit_start->setDateTime(curDateTime);
ui->dateTimeEdit_end->setDateTime(curDateTime);
ui->comboBox_channel->setView(new QListView());
for (int i = 0; i < g_ChannelBaseInfo.size(); i++) {
ui->comboBox_channel->insertItem(i,g_ChannelBaseInfo[i].channelName);
}
connect(ui->comboBox_channel,SIGNAL(currentIndexChanged(const QString &)),this,SLOT(on_comboBox_channel_currentTextChanged(const QString&)));
}
CTrendGraph::~CTrendGraph()
{
delete ui;
}
void CTrendGraph::on_comboBox_channel_currentTextChanged(const QString& strChannelName)
{
int i = 0;
for (i = 0; i < g_ChannelBaseInfo.size(); i++) {
if(strChannelName == g_ChannelBaseInfo[i].channelName){
m_strChannelID = g_ChannelBaseInfo[i].channelID;
break;
}
}
}
void CTrendGraph::on_pushButton_search_clicked()
{
}