void MeshLayerEditDialog::nextButtonPressed() { _layerEdit->setEnabled(false); _nextButton->setEnabled(false); _nLayerExplanation->setText(""); _n_layers = static_cast<unsigned>(_layerEdit->text().toInt()); if (_n_layers == 0) this->createWithRasters(); else { QVBoxLayout* _radiobuttonLayout (new QVBoxLayout(_radioButtonBox)); QRadioButton* selectButton1 (new QRadioButton("Add layers based on raster files", _radioButtonBox)); QRadioButton* selectButton2 (new QRadioButton("Add layers with static thickness", _radioButtonBox)); _radioButtonBox = new QGroupBox(this); _radiobuttonLayout->addWidget(selectButton1); _radiobuttonLayout->addWidget(selectButton2); _radioButtonBox->setLayout(_radiobuttonLayout); gridLayoutLayerMapping->addWidget(_radioButtonBox, 2, 0, 1, 3); // add an empty line to better arrange the following information gridLayoutLayerMapping->addWidget(_nLayerExplanation, 3, 0); connect(selectButton1, SIGNAL(pressed()), this, SLOT(createWithRasters())); connect(selectButton2, SIGNAL(pressed()), this, SLOT(createStatic())); } }
void MeshLayerEditDialog::nextButtonPressed() { _n_layers = static_cast<unsigned>(_layerEdit->text().toInt()); if (_n_layers < 1) { OGSError::box("Add the number of layers to add (at least 1)"); return; } _layerEdit->setEnabled(false); _nextButton->setEnabled(false); QVBoxLayout* _radiobuttonLayout (new QVBoxLayout(_radioButtonBox)); QRadioButton* selectButton1 (new QRadioButton("Add layers based on raster files", _radioButtonBox)); QRadioButton* selectButton2 (new QRadioButton("Add layers with static thickness", _radioButtonBox)); _radioButtonBox = new QGroupBox(this); _radiobuttonLayout->addWidget(selectButton1); _radiobuttonLayout->addWidget(selectButton2); _radioButtonBox->setLayout(_radiobuttonLayout); gridLayoutLayerMapping->addWidget(_radioButtonBox, 2, 0, 1, 3); connect(selectButton1, SIGNAL(pressed()), this, SLOT(createWithRasters())); connect(selectButton2, SIGNAL(pressed()), this, SLOT(createStatic())); }