26 int GuiInputAttribute::GetAttributes(
const QString &defaultAttribute,
27 QString &newAttribute,
35 p_dialog->setWindowTitle(title);
38 p_dialog->SetAttributes(defaultAttribute);
39 if(p_dialog->exec() == QDialog::Accepted) {
40 newAttribute = p_dialog->GetAttributes();
43 newAttribute = defaultAttribute;
50 QRadioButton *allBands =
new QRadioButton(
"&All Bands");
51 allBands->setToolTip(
"Select all bands from the input cube");
53 QRadioButton *listBands =
new QRadioButton(
"&Band List");
54 listBands->setToolTip(
"Select any bands from the input cube");
57 p_buttonGroup =
new QButtonGroup();
58 p_buttonGroup->addButton(allBands);
59 p_buttonGroup->addButton(listBands);
60 p_buttonGroup->setExclusive(
true);
63 p_lineEdit =
new QLineEdit();
64 connect(allBands, SIGNAL(toggled(
bool)), p_lineEdit, SLOT(setDisabled(
bool)));
65 allBands->setChecked(
true);
68 QGridLayout *gridLayout =
new QGridLayout();
69 gridLayout->addWidget(allBands, 0, 0);
70 gridLayout->addWidget(listBands, 1, 0);
71 gridLayout->addWidget(p_lineEdit, 1, 1);
74 QPushButton *okButton =
new QPushButton(
"Ok");
75 connect(okButton, SIGNAL(clicked()),
this, SLOT(accept()));
77 QPushButton *cancelButton =
new QPushButton(
"Cancel");
78 connect(cancelButton, SIGNAL(clicked()),
this, SLOT(reject()));
82 QButtonGroup *actionGroup =
new QButtonGroup();
83 actionGroup->addButton(okButton);
84 actionGroup->addButton(cancelButton);
88 QHBoxLayout *actionLayout =
new QHBoxLayout();
89 actionLayout->addWidget(okButton);
90 actionLayout->addWidget(cancelButton);
93 QVBoxLayout *dialogLayout =
new QVBoxLayout(
this);
94 dialogLayout->addLayout(gridLayout);
95 dialogLayout->addLayout(actionLayout);