LibrePCB Developers Documentation
patheditorwidget.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_PATHEDITORWIDGET_H
21 #define LIBREPCB_PATHEDITORWIDGET_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../geometry/path.h"
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 class EditableTableWidget;
37 class PathModel;
38 class LengthDelegate;
39 
40 /*******************************************************************************
41  * Class PathEditorWidget
42  ******************************************************************************/
43 
47 class PathEditorWidget final : public QWidget {
48  Q_OBJECT
49 
50 public:
51  // Constructors / Destructor
52  explicit PathEditorWidget(QWidget* parent = nullptr) noexcept;
53  PathEditorWidget(const PathEditorWidget& other) = delete;
54  ~PathEditorWidget() noexcept;
55 
56  // General Methods
57  void setPath(const Path& path) noexcept;
58  const Path& getPath() const noexcept;
59  void setLengthUnit(const LengthUnit& unit) noexcept;
60 
61  // Operator Overloadings
62  PathEditorWidget& operator=(const PathEditorWidget& rhs) = delete;
63 
64 private: // Data
65  QScopedPointer<PathModel> mModel;
66  QScopedPointer<EditableTableWidget> mView;
69 };
70 
71 /*******************************************************************************
72  * End of File
73  ******************************************************************************/
74 
75 } // namespace librepcb
76 
77 #endif // LIBREPCB_PATHEDITORWIDGET_H
Subclass of QStyledItemDelegate to display/edit librepcb::Length values.
Definition: lengthdelegate.h:44
The PathEditorWidget class.
Definition: patheditorwidget.h:47
Definition: airwiresbuilder.cpp:32
void setLengthUnit(const LengthUnit &unit) noexcept
Definition: patheditorwidget.cpp:94
PathEditorWidget & operator=(const PathEditorWidget &rhs)=delete
~PathEditorWidget() noexcept
Definition: patheditorwidget.cpp:79
LengthDelegate * mLengthDelegateX
Definition: patheditorwidget.h:67
QScopedPointer< EditableTableWidget > mView
Definition: patheditorwidget.h:66
const Path & getPath() const noexcept
Definition: patheditorwidget.cpp:90
The Path class represents a list of vertices connected by straight lines or circular arc segments...
Definition: path.h:53
LengthDelegate * mLengthDelegateY
Definition: patheditorwidget.h:68
PathEditorWidget(QWidget *parent=nullptr) noexcept
Definition: patheditorwidget.cpp:42
void setPath(const Path &path) noexcept
Definition: patheditorwidget.cpp:86
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:62
QScopedPointer< PathModel > mModel
Definition: patheditorwidget.h:65