numberpadwidget.hh 820 Bytes
Newer Older
1
2
3
#ifndef RADIX_RADIXWIDGETS_NUMBERPADWIDGET_HH_
#define RADIX_RADIXWIDGETS_NUMBERPADWIDGET_HH_

Huff, Israel's avatar
Huff, Israel committed
4
#include <QGridLayout>
5
#include <QLineEdit>
Huff, Israel's avatar
Huff, Israel committed
6
7
#include <QPushButton>
#include <QSignalMapper>
8
9
#include <QWidget>

10
#include "radixcore/visibility.hh"
11
12
namespace radix
{
13
class RADIX_PUBLIC NumberPadWidget : public QLineEdit
14
15
16
{
  Q_OBJECT

Huff, Israel's avatar
Huff, Israel committed
17
  QSignalMapper* mMapper;
18
  QWidget* mNumberWidget;
Huff, Israel's avatar
Huff, Israel committed
19
  QGridLayout* mNumLayout;
20
  bool mToggle;
21
22

 public:
23
  NumberPadWidget(QWidget* parent = nullptr, bool toggle = false);
24
25
26
27
28
29
30
31

 public slots:
  void focusInEvent(QFocusEvent*) override;
  void focusOutEvent(QFocusEvent*) override;
  bool numberPadVisible() const;

 private slots:
  void buttonClicked(int key);
32
33
  void makePositive();
  void makeNegative();
34
35
36
};  // class
}  // namespace radix
#endif /** RADIX_RADIXWIDGETS_NUMBERPADWIDGET_HH_ */