Isis 3 Programmer Reference
BandSpinBox.h
1 #ifndef BandSpinBox_h
2 #define BandSpinBox_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QSpinBox>
13 #include <QMap>
14 
15 #include "Pvl.h"
16 
17 namespace Isis {
23  class BandSpinBox : public QSpinBox {
24  Q_OBJECT
25 
26  public:
27  BandSpinBox(QWidget *parent = 0);
28  void setBandBin(Pvl &pvl, const QString &key = "BandNumber");
30  QSize sizeHint() const;
31  QValidator::State validate(QString &input, int &pos) const;
32 
33  public slots:
34  void setKey(QString key);
35  void setKey(int key);
36 
37  protected:
38  QString textFromValue(int val) const;
39  int valueFromText(const QString &text) const;
40 
41  private:
42  int p_bands;
43 
45  QString p_lastKey;
47  };
48 }
49 
50 #endif
Isis::BandSpinBox
Definition: BandSpinBox.h:23
QWidget
Isis::BandSpinBox::setKey
void setKey(QString key)
Sets the key to the provided key.
Definition: BandSpinBox.cpp:101
Isis::BandSpinBox::p_keys
QStringList p_keys
List of all the keys.
Definition: BandSpinBox.h:46
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::BandSpinBox::valueFromText
int valueFromText(const QString &text) const
gets the value (int) using p_map.
Definition: BandSpinBox.cpp:165
QStringList
Isis::BandSpinBox::setBandBin
void setBandBin(Pvl &pvl, const QString &key="BandNumber")
Sets the band bin.
Definition: BandSpinBox.cpp:41
Isis::BandSpinBox::textFromValue
QString textFromValue(int val) const
Gets the text using p_map.
Definition: BandSpinBox.cpp:141
Isis::BandSpinBox::BandSpinBox
BandSpinBox(QWidget *parent=0)
BandSpinBox constructor.
Definition: BandSpinBox.cpp:21
Isis::BandSpinBox::sizeHint
QSize sizeHint() const
returns a size hint for the spin box
Definition: BandSpinBox.cpp:182
Isis::BandSpinBox::p_map
QMap< QString, QStringList > p_map
The maps the last key to all the keys.
Definition: BandSpinBox.h:44
Isis::BandSpinBox::p_lastKey
QString p_lastKey
The last key.
Definition: BandSpinBox.h:45
Isis::BandSpinBox::p_bands
int p_bands
Number of bands.
Definition: BandSpinBox.h:42
QMap< QString, QStringList >
Isis::BandSpinBox::validate
QValidator::State validate(QString &input, int &pos) const
returns how valid the value from the spin box is.
Definition: BandSpinBox.cpp:216
Isis::BandSpinBox::BandBinKeys
QStringList BandBinKeys()
returns the list of keys.
Definition: BandSpinBox.cpp:90
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
QSpinBox