59 lines
1.4 KiB
C++
59 lines
1.4 KiB
C++
#include "CopyChannelSetting.h"
|
|
#include "ui_CopyChannelSetting.h"
|
|
|
|
#include<QGridLayout>
|
|
|
|
CopyChannelSetting::CopyChannelSetting(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::CopyChannelSetting)
|
|
{
|
|
ui->setupUi(this);
|
|
}
|
|
|
|
CopyChannelSetting::~CopyChannelSetting()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void CopyChannelSetting::displayCopyChannel()
|
|
{
|
|
QGridLayout* layout = new QGridLayout(ui->widget);
|
|
int col = 0,row = 0;
|
|
for(int i = 0; i < copyChannel.size();i++){
|
|
QCheckBox *checkButton = new QCheckBox(copyChannel[i].channelName,ui->widget);
|
|
|
|
if(!int((i+1) % 2)){
|
|
layout->addWidget(checkButton, col, row);
|
|
col ++ ;
|
|
row = 0;
|
|
}else{
|
|
layout->addWidget(checkButton, col, row);
|
|
row ++ ;
|
|
|
|
}
|
|
m_listCheckBox.append(checkButton);
|
|
}
|
|
}
|
|
|
|
void CopyChannelSetting::on_pushButton_confirm_clicked()
|
|
{
|
|
QStringList listChannelName;
|
|
for (int i = 0; i < m_listCheckBox.size(); i++) {
|
|
if(m_listCheckBox[i]->checkState()){
|
|
qDebug() << m_listCheckBox[i]->text() << endl;
|
|
listChannelName.append(m_listCheckBox[i]->text());
|
|
}
|
|
}
|
|
sgSetChannelData(listChannelName);
|
|
this->close();
|
|
}
|
|
|
|
|
|
void CopyChannelSetting::on_pushButton_selectAll_clicked()
|
|
{
|
|
for (int i = 0; i < m_listCheckBox.size(); i++) {
|
|
m_listCheckBox[i]->setCheckState(Qt::Checked);
|
|
}
|
|
}
|
|
|