LibrePCB Developers Documentation
angleedit.h
Go to the documentation of this file.
1 /*
2  * LibrePCB - Professional EDA for everyone!
3  * Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
4  * https://librepcb.org/
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef LIBREPCB_EDITOR_ANGLEEDIT_H
21 #define LIBREPCB_EDITOR_ANGLEEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../widgets/numbereditbase.h"
27 
29 
30 #include <QtCore>
31 #include <QtWidgets>
32 
33 /*******************************************************************************
34  * Namespace / Forward Declarations
35  ******************************************************************************/
36 namespace librepcb {
37 namespace editor {
38 
39 /*******************************************************************************
40  * Class AngleEdit
41  ******************************************************************************/
42 
46 class AngleEdit final : public NumberEditBase {
47  Q_OBJECT
48 
49 public:
50  // Constructors / Destructor
51  explicit AngleEdit(QWidget* parent = nullptr) noexcept;
52  AngleEdit(const AngleEdit& other) = delete;
53  virtual ~AngleEdit() noexcept;
54 
55  // Getters
56  const Angle& getValue() const noexcept { return mValue; }
57 
58  // Setters
59  void setValue(const Angle& value) noexcept;
60 
61  // Operator Overloadings
62  AngleEdit& operator=(const AngleEdit& rhs) = delete;
63 
64 signals:
65  void valueChanged(const Angle& value);
66 
67 private: // Methods
68  void updateSpinBox() noexcept override;
69  void spinBoxValueChanged(double value) noexcept override;
70 
71 private: // Data
73 };
74 
75 /*******************************************************************************
76  * End of File
77  ******************************************************************************/
78 
79 } // namespace editor
80 } // namespace librepcb
81 
82 #endif
void updateSpinBox() noexcept override
Definition: angleedit.cpp:65
void spinBoxValueChanged(double value) noexcept override
Definition: angleedit.cpp:69
Definition: occmodel.cpp:77
void valueChanged(const Angle &value)
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
const Angle & getValue() const noexcept
Definition: angleedit.h:56
AngleEdit(QWidget *parent=nullptr) noexcept
Definition: angleedit.cpp:39
The AngleEdit class is a widget to view/edit librepcb::Angle values.
Definition: angleedit.h:46
The NumberEditBase class is a widget base class to edit various kinds of numbers. ...
Definition: numbereditbase.h:49
AngleEdit & operator=(const AngleEdit &rhs)=delete
Angle mValue
Definition: angleedit.h:72
void setValue(const Angle &value) noexcept
Definition: angleedit.cpp:54
virtual ~AngleEdit() noexcept
Definition: angleedit.cpp:47