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_EDITOR_LENGTHEDIT_H
21#define LIBREPCB_EDITOR_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 ******************************************************************************/
34namespace librepcb {
35namespace editor {
36
37/*******************************************************************************
38 * Class LengthEdit
39 ******************************************************************************/
40
45class LengthEdit final : public LengthEditBase {
46 Q_OBJECT
47
48public:
49 // Constructors / Destructor
50 explicit LengthEdit(QWidget* parent = nullptr) noexcept;
51 LengthEdit(const LengthEdit& other) = delete;
52 virtual ~LengthEdit() noexcept;
53
54 // Getters
55 Length getValue() const noexcept;
56
57 // Setters
58 void setValue(const Length& value) noexcept;
59
60 // Operator Overloadings
61 LengthEdit& operator=(const LengthEdit& rhs) = delete;
62
63signals:
64 // Note: Full namespace librepcb::Length is required for the MOC!
65 void valueChanged(const librepcb::Length& value,
66 const librepcb::Length& diff);
67
68private:
69 virtual void valueChangedImpl(const Length& diff) noexcept override;
70};
71
72/*******************************************************************************
73 * End of File
74 ******************************************************************************/
75
76} // namespace editor
77} // namespace librepcb
78
79#endif
The Length class is used to represent a length (for example 12.75 millimeters)
Definition: length.h:83
The LengthEditBase class.
Definition: lengtheditbase.h:47
The LengthEdit class is a widget to view/edit librepcb::Length values.
Definition: lengthedit.h:45
LengthEdit(const LengthEdit &other)=delete
virtual void valueChangedImpl(const Length &diff) noexcept override
Definition: lengthedit.cpp:64
Length getValue() const noexcept
Definition: lengthedit.cpp:48
virtual ~LengthEdit() noexcept
Definition: lengthedit.cpp:41
LengthEdit(QWidget *parent=nullptr) noexcept
Definition: lengthedit.cpp:37
void valueChanged(const librepcb::Length &value, const librepcb::Length &diff)
void setValue(const Length &value) noexcept
Definition: lengthedit.cpp:56
Definition: occmodel.cpp:77