LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_ANGLEEDIT_H
21 #define LIBREPCB_ANGLEEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../units/angle.h"
27 #include "numbereditbase.h"
28 
29 #include <QtCore>
30 #include <QtWidgets>
31 
32 /*******************************************************************************
33  * Namespace / Forward Declarations
34  ******************************************************************************/
35 namespace librepcb {
36 
37 /*******************************************************************************
38  * Class AngleEdit
39  ******************************************************************************/
40 
44 class AngleEdit final : public NumberEditBase {
45  Q_OBJECT
46 
47 public:
48  // Constructors / Destructor
49  explicit AngleEdit(QWidget* parent = nullptr) noexcept;
50  AngleEdit(const AngleEdit& other) = delete;
51  virtual ~AngleEdit() noexcept;
52 
53  // Getters
54  const Angle& getValue() const noexcept { return mValue; }
55 
56  // Setters
57  void setValue(const Angle& value) noexcept;
58 
59  // Operator Overloadings
60  AngleEdit& operator=(const AngleEdit& rhs) = delete;
61 
62 signals:
63  void valueChanged(const Angle& value);
64 
65 private: // Methods
66  void updateSpinBox() noexcept override;
67  void spinBoxValueChanged(double value) noexcept override;
68 
69 private: // Data
71 };
72 
73 /*******************************************************************************
74  * End of File
75  ******************************************************************************/
76 
77 } // namespace librepcb
78 
79 #endif // LIBREPCB_ANGLEEDIT_H
virtual ~AngleEdit() noexcept
Definition: angleedit.cpp:44
AngleEdit & operator=(const AngleEdit &rhs)=delete
void spinBoxValueChanged(double value) noexceptoverride
Definition: angleedit.cpp:66
void valueChanged(const Angle &value)
Angle mValue
Definition: angleedit.h:70
The Angle class is used to represent an angle (for example 12.75 degrees)
Definition: angle.h:78
The NumberEditBase class is a widget base class to edit various kinds of numbers. ...
Definition: numbereditbase.h:48
The AngleEdit class is a widget to view/edit librepcb::Angle values.
Definition: angleedit.h:44
void updateSpinBox() noexceptoverride
Definition: angleedit.cpp:62
const Angle & getValue() const noexcept
Definition: angleedit.h:54
void setValue(const Angle &value) noexcept
Definition: angleedit.cpp:51
AngleEdit(QWidget *parent=nullptr) noexcept
Definition: angleedit.cpp:36