Isis 3 Programmer Reference
BandSpinBox.h
1 #ifndef BandSpinBox_h
2 #define BandSpinBox_h
3 
4 #include <QSpinBox>
5 #include <QMap>
6 
7 #include "Pvl.h"
8 
9 namespace Isis {
15  class BandSpinBox : public QSpinBox {
16  Q_OBJECT
17 
18  public:
19  BandSpinBox(QWidget *parent = 0);
20  void setBandBin(Pvl &pvl, const QString &key = "BandNumber");
22  QSize sizeHint() const;
23  QValidator::State validate(QString &input, int &pos) const;
24 
25  public slots:
26  void setKey(QString key);
27  void setKey(int key);
28 
29  protected:
30  QString textFromValue(int val) const;
31  int valueFromText(const QString &text) const;
32 
33  private:
34  int p_bands;
35 
37  QString p_lastKey;
39  };
40 }
41 
42 #endif
QValidator::State validate(QString &input, int &pos) const
returns how valid the value from the spin box is.
QStringList p_keys
List of all the keys.
Definition: BandSpinBox.h:38
void setKey(QString key)
Sets the key to the provided key.
Definition: BandSpinBox.cpp:93
QString textFromValue(int val) const
Gets the text using p_map.
void setBandBin(Pvl &pvl, const QString &key="BandNumber")
Sets the band bin.
Definition: BandSpinBox.cpp:33
int valueFromText(const QString &text) const
gets the value (int) using p_map.
QSize sizeHint() const
returns a size hint for the spin box
Container for cube-like labels.
Definition: Pvl.h:135
BandSpinBox(QWidget *parent=0)
BandSpinBox constructor.
Definition: BandSpinBox.cpp:13
QString p_lastKey
The last key.
Definition: BandSpinBox.h:37
QStringList BandBinKeys()
returns the list of keys.
Definition: BandSpinBox.cpp:82
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QMap< QString, QStringList > p_map
The maps the last key to all the keys.
Definition: BandSpinBox.h:36
int p_bands
Number of bands.
Definition: BandSpinBox.h:34