LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  explicit GridSettingsDialog(const GridProperties& grid, QWidget* parent = 0);
55 
56  // Getters
57  const GridProperties& getGrid() const noexcept { return mCurrentGrid; }
58 
59 private slots:
60 
61  // Private Slots
62  void rbtnGroupClicked(int id);
63  void spbxIntervalChanged(double value);
64  void cbxUnitsChanged(int index);
65  void btnMul2Clicked();
66  void btnDiv2Clicked();
67  void buttonBoxClicked(QAbstractButton* button);
68 
69 signals:
70 
71  void gridPropertiesChanged(const GridProperties& grid);
72 
73 private:
74  // make some methods inaccessible...
78 
79  // Private Methods
80  void updateInternalRepresentation() noexcept;
81 
82  // General Attributes
86 };
87 
88 /*******************************************************************************
89  * End of File
90  ******************************************************************************/
91 
92 } // namespace librepcb
93 
94 #endif // LIBREPCB_GRIDSETTINGSDIALOG_H
void cbxUnitsChanged(int index)
Definition: gridsettingsdialog.cpp:107
void btnMul2Clicked()
Definition: gridsettingsdialog.cpp:119
void btnDiv2Clicked()
Definition: gridsettingsdialog.cpp:123
void spbxIntervalChanged(double value)
Definition: gridsettingsdialog.cpp:99
GridProperties mOriginalGrid
Definition: gridsettingsdialog.h:84
The GridProperties class.
Definition: gridproperties.h:43
GridSettingsDialog & operator=(const GridSettingsDialog &rhs)
const GridProperties & getGrid() const noexcept
Definition: gridsettingsdialog.h:57
Ui::GridSettingsDialog * mUi
Definition: gridsettingsdialog.h:83
void updateInternalRepresentation() noexcept
Definition: gridsettingsdialog.cpp:165
void rbtnGroupClicked(int id)
Definition: gridsettingsdialog.cpp:93
GridProperties mCurrentGrid
Definition: gridsettingsdialog.h:85
This class provides a Dialog (GUI) to change the grid settings of a #GraphicsView.
Definition: gridsettingsdialog.h:48
~GridSettingsDialog()
Definition: gridsettingsdialog.cpp:84
void buttonBoxClicked(QAbstractButton *button)
Definition: gridsettingsdialog.cpp:127
void gridPropertiesChanged(const GridProperties &grid)