LibrePCB Developers Documentation
lengthedit.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_LENGTHEDIT_H
21 #define LIBREPCB_LENGTHEDIT_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "lengtheditbase.h"
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 /*******************************************************************************
37  * Class LengthEdit
38  ******************************************************************************/
39 
44 class LengthEdit final : public LengthEditBase {
45  Q_OBJECT
46 
47 public:
48  // Constructors / Destructor
49  explicit LengthEdit(QWidget* parent = nullptr) noexcept;
50  LengthEdit(const LengthEdit& other) = delete;
51  virtual ~LengthEdit() noexcept;
52 
53  // Getters
54  Length getValue() const noexcept;
55 
56  // Setters
57  void setValue(const Length& value) noexcept;
58 
59  // Operator Overloadings
60  LengthEdit& operator=(const LengthEdit& rhs) = delete;
61 
62 signals:
63  // Note: Full namespace librepcb::Length is required for the MOC!
64  void valueChanged(const librepcb::Length& value);
65 
66 private:
67  virtual void valueChangedImpl() noexcept override;
68 };
69 
70 /*******************************************************************************
71  * End of File
72  ******************************************************************************/
73 
74 } // namespace librepcb
75 
76 #endif // LIBREPCB_LENGTHEDIT_H
The LengthEdit class is a widget to view/edit librepcb::Length values.
Definition: lengthedit.h:44
void valueChanged(const librepcb::Length &value)
Definition: airwiresbuilder.cpp:32
virtual void valueChangedImpl() noexcept override
Definition: lengthedit.cpp:63
void setValue(const Length &value) noexcept
Definition: lengthedit.cpp:55
The LengthEditBase class.
Definition: lengtheditbase.h:45
Length getValue() const noexcept
Definition: lengthedit.cpp:47
LengthEdit & operator=(const LengthEdit &rhs)=delete
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:82
virtual ~LengthEdit() noexcept
Definition: lengthedit.cpp:40
LengthEdit(QWidget *parent=nullptr) noexcept
Definition: lengthedit.cpp:36