LibrePCB Developers Documentation
unsignedlimitedratioedit.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_UNSIGNEDLIMITEDRATIOEDIT_H
21#define LIBREPCB_EDITOR_UNSIGNEDLIMITEDRATIOEDIT_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 ******************************************************************************/
36namespace librepcb {
37namespace editor {
38
39/*******************************************************************************
40 * Class UnsignedLimitedRatioEdit
41 ******************************************************************************/
42
48 Q_OBJECT
49
50public:
51 // Constructors / Destructor
52 explicit UnsignedLimitedRatioEdit(QWidget* parent = nullptr) noexcept;
54 virtual ~UnsignedLimitedRatioEdit() noexcept;
55
56 // Getters
57 const UnsignedLimitedRatio& getValue() const noexcept { return mValue; }
58
59 // Setters
60 void setValue(const UnsignedLimitedRatio& value) noexcept;
61
62 // Operator Overloadings
64 delete;
65
66signals:
68
69private: // Methods
70 void updateSpinBox() noexcept override;
71 void spinBoxValueChanged(double value) noexcept override;
72
73private: // Data
77};
78
79/*******************************************************************************
80 * End of File
81 ******************************************************************************/
82
83} // namespace editor
84} // namespace librepcb
85
86#endif
The NumberEditBase class is a widget base class to edit various kinds of numbers.
Definition: numbereditbase.h:49
The UnsignedLimitedRatioEdit class is a widget to view/edit librepcb::UnsignedLimitedRatio values.
Definition: unsignedlimitedratioedit.h:47
UnsignedLimitedRatioEdit & operator=(const UnsignedLimitedRatioEdit &rhs)=delete
void valueChanged(const UnsignedLimitedRatio &value)
UnsignedLimitedRatioEdit(const UnsignedLimitedRatioEdit &other)=delete
virtual ~UnsignedLimitedRatioEdit() noexcept
Definition: unsignedlimitedratioedit.cpp:46
void spinBoxValueChanged(double value) noexcept override
Definition: unsignedlimitedratioedit.cpp:71
UnsignedLimitedRatio mMaxValue
Definition: unsignedlimitedratioedit.h:75
const UnsignedLimitedRatio & getValue() const noexcept
Definition: unsignedlimitedratioedit.h:57
UnsignedLimitedRatioEdit(QWidget *parent=nullptr) noexcept
Definition: unsignedlimitedratioedit.cpp:37
UnsignedLimitedRatio mMinValue
Definition: unsignedlimitedratioedit.h:74
void updateSpinBox() noexcept override
Definition: unsignedlimitedratioedit.cpp:65
void setValue(const UnsignedLimitedRatio &value) noexcept
Definition: unsignedlimitedratioedit.cpp:53
UnsignedLimitedRatio mValue
Definition: unsignedlimitedratioedit.h:76
Definition: occmodel.cpp:77
type_safe::constrained_type< Ratio, UnsignedLimitedRatioConstraint, UnsignedLimitedRatioVerifier > UnsignedLimitedRatio
Definition: ratio.h:378