summaryrefslogtreecommitdiff
path: root/widgets/FrequencyLineEdit.hpp
blob: 3e5d9a85859a84fd58ec01ae09c8db16b3162953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef FREQUENCY_LINE_EDIT_HPP_
#define FREQUENCY_LINE_EDIT_HPP_

#include <QLineEdit>

#include "Radio.hpp"

class QWidget;

//
// MHz frequency line edit with validation
//
class FrequencyLineEdit final
  : public QLineEdit
{
  Q_OBJECT;
  Q_PROPERTY (Frequency frequency READ frequency WRITE frequency USER true);

public:
  using Frequency = Radio::Frequency;

  explicit FrequencyLineEdit (QWidget * parent = nullptr);

  // Property frequency implementation
  Frequency frequency () const;
  void frequency (Frequency);
};

#endif