diff options
| author | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-04-07 19:02:45 +0200 |
| commit | f647d78463c1250ce9c99af664615fafccf5e959 (patch) | |
| tree | 5b00428cef68aef1c9d407e2d4535687422419b6 /validators/LiveFrequencyValidator.hpp | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
New upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'validators/LiveFrequencyValidator.hpp')
| -rw-r--r--[-rwxr-xr-x] | validators/LiveFrequencyValidator.hpp | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/validators/LiveFrequencyValidator.hpp b/validators/LiveFrequencyValidator.hpp index 7f19c25a..f0ab05fb 100755..100644 --- a/validators/LiveFrequencyValidator.hpp +++ b/validators/LiveFrequencyValidator.hpp @@ -1,57 +1,57 @@ -#ifndef LIVE_FREQUENCY_VALIDATOR_HPP__
-#define LIVE_FREQUENCY_VALIDATOR_HPP__
-
-#include <QObject>
-#include <QRegExpValidator>
-
-#include "Radio.hpp"
-#include "Configuration.hpp"
-
-class Bands;
-class FrequencyList_v2_101;
-class QComboBox;
-class QWidget;
-
-//
-// Class LiveFrequencyValidator
-//
-// QLineEdit validator that controls input to an editable
-// QComboBox where the user can enter a valid band or a valid
-// frequency in megahetz.
-//
-// Collabrations
-//
-// Implements the QRegExpValidator interface. Validates input
-// from the supplied QComboBox as either a valid frequency in
-// megahertz or a valid band as defined by the supplied column of
-// the supplied QAbstractItemModel.
-//
-class LiveFrequencyValidator final
- : public QRegExpValidator
-{
- Q_OBJECT;
-
-public:
- using Frequency = Radio::Frequency;
-
- LiveFrequencyValidator (QComboBox * combo_box // associated combo box
- , Bands const * bands // bands model
- , FrequencyList_v2_101 const * frequencies // working frequencies model
- , Frequency const * nominal_frequency
- , bool kHz_without_k
- , QWidget * parent = nullptr);
-
- State validate (QString& input, int& pos) const override;
- void fixup (QString& input) const override;
-
- Q_SIGNAL void valid (Frequency) const;
-
-private:
- Bands const * bands_;
- FrequencyList_v2_101 const * frequencies_;
- Frequency const * nominal_frequency_;
- QComboBox * combo_box_;
- bool kHz_without_k_ = false;
-};
-
-#endif
+#ifndef LIVE_FREQUENCY_VALIDATOR_HPP__ +#define LIVE_FREQUENCY_VALIDATOR_HPP__ + +#include <QObject> +#include <QRegExpValidator> + +#include "Radio.hpp" +#include "Configuration.hpp" + +class Bands; +class FrequencyList_v2_101; +class QComboBox; +class QWidget; + +// +// Class LiveFrequencyValidator +// +// QLineEdit validator that controls input to an editable +// QComboBox where the user can enter a valid band or a valid +// frequency in megahetz. +// +// Collabrations +// +// Implements the QRegExpValidator interface. Validates input +// from the supplied QComboBox as either a valid frequency in +// megahertz or a valid band as defined by the supplied column of +// the supplied QAbstractItemModel. +// +class LiveFrequencyValidator final + : public QRegExpValidator +{ + Q_OBJECT; + +public: + using Frequency = Radio::Frequency; + + LiveFrequencyValidator (QComboBox * combo_box // associated combo box + , Bands const * bands // bands model + , FrequencyList_v2_101 const * frequencies // working frequencies model + , Frequency const * nominal_frequency + , bool kHz_without_k + , QWidget * parent = nullptr); + + State validate (QString& input, int& pos) const override; + void fixup (QString& input) const override; + + Q_SIGNAL void valid (Frequency) const; + +private: + Bands const * bands_; + FrequencyList_v2_101 const * frequencies_; + Frequency const * nominal_frequency_; + QComboBox * combo_box_; + bool kHz_without_k_ = false; +}; + +#endif |
