3 #include "BandSpinBox.h"
15 list.push_back(QString::number(1));
35 disconnect(
this, 0, 0, 0);
41 .findGroup(
"Dimensions");
46 for(
int i = 1; i <=
p_bands; i++) {
47 list.push_back(QString::number(i));
49 p_map[
"BandNumber"] = list;
52 if(pvl.
findObject(
"IsisCube").hasGroup(
"BandBin")) {
54 .findGroup(
"BandBin");
55 for(
int i = 0; i < bandBin.
keywords(); i++) {
57 if(bandBin[i].size() ==
p_bands) {
58 for(
int j = 0; j < bandBin[i].size(); j++) {
59 list.push_back(QString(bandBin[i][j]));
61 QString bandBinName = bandBin[i].
name();
62 p_map[bandBinName] = list;
94 if(
p_map.contains(key)) {
116 if((key < 0) || (key >= (
int)
p_map.size())) {
134 if((val < 1) || (val >
p_bands)) {
135 std::cout <<
"BandSpinBox: Bad index in textFromValue" << std::endl;
136 return QString(
"Error");
143 std::cout <<
"BandSpinBox: Bad value for p_lastKey in textFromValue" << std::endl;
144 return QString(
"Error");
163 std::cout <<
"BandSpinBox: Bad text in valueFromText" << std::endl;
175 QFontMetrics fm(font());
178 for(
int i = minimum(); i <= maximum(); i++) {
179 w = qMax(w, fm.width(((
BandSpinBox *)
this)->textFromValue(i)));
183 int neww = s.width() + w;
194 s.setWidth(neww + 5);
216 if(count == 0)
return QValidator::Invalid;
217 if(count > 0 && exact)
return QValidator::Acceptable;
218 return QValidator::Intermediate;