LibrePCB Developers Documentation
gridsettingsdialog.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_GRIDSETTINGSDIALOG_H
21 #define LIBREPCB_GRIDSETTINGSDIALOG_H
22 
23 /*******************************************************************************
24  * Includes
25  ******************************************************************************/
26 #include "../gridproperties.h"
27 
28 #include <QtCore>
29 #include <QtWidgets>
30 
31 /*******************************************************************************
32  * Namespace / Forward Declarations
33  ******************************************************************************/
34 namespace librepcb {
35 
36 namespace Ui {
37 class GridSettingsDialog;
38 }
39 
40 /*******************************************************************************
41  * Class GridSettingsDialog
42  ******************************************************************************/
43 
48 class GridSettingsDialog final : public QDialog {
49  Q_OBJECT
50 
51 public:
52  // Constructors / Destructor
53  GridSettingsDialog() = delete;
54  GridSettingsDialog(const GridSettingsDialog& other) = delete;
55  explicit GridSettingsDialog(const GridProperties& grid,
56  QWidget* parent = nullptr) noexcept;
57  ~GridSettingsDialog() noexcept;
58 
59  // Getters
60  const GridProperties& getGrid() const noexcept { return mCurrentGrid; }
61 
62  // Operator Overloadings
63  GridSettingsDialog& operator=(const GridSettingsDialog& rhs) = delete;
64 
65 signals:
66  void gridPropertiesChanged(const GridProperties& grid);
67 
68 private: // Methods
69  void rbtnGroupClicked(int id) noexcept;
70  void edtIntervalValueChanged(const PositiveLength& value) noexcept;
71  void edtIntervalUnitChanged(const LengthUnit& unit) noexcept;
72  void buttonBoxClicked(QAbstractButton* button) noexcept;
73 
74 private: // Data
75  QScopedPointer<Ui::GridSettingsDialog> mUi;
78 };
79 
80 /*******************************************************************************
81  * End of File
82  ******************************************************************************/
83 
84 } // namespace librepcb
85 
86 #endif // LIBREPCB_GRIDSETTINGSDIALOG_H
Definition: mainwindow.h:10
Definition: airwiresbuilder.cpp:32
GridProperties mOriginalGrid
Definition: gridsettingsdialog.h:76
The GridProperties class.
Definition: gridproperties.h:43
const GridProperties & getGrid() const noexcept
Definition: gridsettingsdialog.h:60
QScopedPointer< Ui::GridSettingsDialog > mUi
Definition: gridsettingsdialog.h:75
GridProperties mCurrentGrid
Definition: gridsettingsdialog.h:77
This class provides a Dialog (GUI) to change the grid settings of a librepcb::GraphicsView.
Definition: gridsettingsdialog.h:48
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:794
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:62