47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#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()
|
||
{
|
||
|
||
}
|
||
|