Monitor Window is the only class who should have access to the CheckBoxes. I declared it private.
So here a small example of how I use the checkboxes in other functions:
void MonitorWindow::on_CreateListButton_clicked(){
QCheckBox *DataCheckbox
[AvailableData.
count()];
for (int i = 0; i < AvailableData.count(); i++){
connect(DataCheckbox[i],SIGNAL(clicked()),SLOT(setTransducerFlags()));
}
}
void MonitorWindow::on_CreateListButton_clicked(){
QCheckBox *DataCheckbox[AvailableData.count()];
for (int i = 0; i < AvailableData.count(); i++){
DataCheckbox[i] = new QCheckBox(this);
connect(DataCheckbox[i],SIGNAL(clicked()),SLOT(setTransducerFlags()));
}
}
To copy to clipboard, switch view to plain text mode
void MonitorWindow::setTransducerFlags(){
for (int i = 0; i< AvailableData.count(); i++){
if(DataCheckbox[i]->isChecked()){
...
}
else{
...
}
}
}
void MonitorWindow::setTransducerFlags(){
for (int i = 0; i< AvailableData.count(); i++){
if(DataCheckbox[i]->isChecked()){
...
}
else{
...
}
}
}
To copy to clipboard, switch view to plain text mode
void MonitorWindow::startRecord(){
...
for (int i = 0; i < AvailableData.count(); i++){
DataCheckbox[i]->setEnabled(false);
}
...
}
void MonitorWindow::startRecord(){
...
for (int i = 0; i < AvailableData.count(); i++){
DataCheckbox[i]->setEnabled(false);
}
...
}
To copy to clipboard, switch view to plain text mode
Bookmarks