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_EDITOR_GRIDSETTINGSDIALOG_H
21#define LIBREPCB_EDITOR_GRIDSETTINGSDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
29
30#include <QtCore>
31#include <QtWidgets>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37namespace editor {
38
39namespace Ui {
40class GridSettingsDialog;
41}
42
43/*******************************************************************************
44 * Class GridSettingsDialog
45 ******************************************************************************/
46
51class GridSettingsDialog final : public QDialog {
52 Q_OBJECT
53
54public:
55 // Constructors / Destructor
57 GridSettingsDialog(const GridSettingsDialog& other) = delete;
58 explicit GridSettingsDialog(const PositiveLength& interval,
59 const LengthUnit& unit, Theme::GridStyle style,
60 QWidget* parent = nullptr) noexcept;
61 ~GridSettingsDialog() noexcept;
62
63 // Getters
64 const PositiveLength& getInterval() const noexcept {
66 }
67 const LengthUnit& getUnit() const noexcept { return mCurrentGrid.unit; }
68 Theme::GridStyle getStyle() const noexcept { return mCurrentGrid.style; }
69
70 // Operator Overloadings
72
73signals:
75 const LengthUnit& unit, Theme::GridStyle style);
76
77private: // Methods
78 void rbtnGroupClicked(int id) noexcept;
79 void edtIntervalValueChanged(const PositiveLength& value) noexcept;
80 void edtIntervalUnitChanged(const LengthUnit& unit) noexcept;
81 void buttonBoxClicked(QAbstractButton* button) noexcept;
82
83private: // Data
84 struct Grid {
88 };
89
90 QScopedPointer<Ui::GridSettingsDialog> mUi;
93};
94
95/*******************************************************************************
96 * End of File
97 ******************************************************************************/
98
99} // namespace editor
100} // namespace librepcb
101
102#endif
The LengthUnit class represents a length unit (millimeters, inches,...) and provides some useful meth...
Definition: lengthunit.h:60
GridStyle
Definition: theme.h:49
This class provides a Dialog (GUI) to change the grid settings of a librepcb::editor::GraphicsView.
Definition: gridsettingsdialog.h:51
void edtIntervalValueChanged(const PositiveLength &value) noexcept
Definition: gridsettingsdialog.cpp:102
void edtIntervalUnitChanged(const LengthUnit &unit) noexcept
Definition: gridsettingsdialog.cpp:109
QScopedPointer< Ui::GridSettingsDialog > mUi
Definition: gridsettingsdialog.h:90
void gridPropertiesChanged(const PositiveLength &interval, const LengthUnit &unit, Theme::GridStyle style)
const LengthUnit & getUnit() const noexcept
Definition: gridsettingsdialog.h:67
GridSettingsDialog & operator=(const GridSettingsDialog &rhs)=delete
Grid mOriginalGrid
Definition: gridsettingsdialog.h:91
Grid mCurrentGrid
Definition: gridsettingsdialog.h:92
const PositiveLength & getInterval() const noexcept
Definition: gridsettingsdialog.h:64
Theme::GridStyle getStyle() const noexcept
Definition: gridsettingsdialog.h:68
GridSettingsDialog(const GridSettingsDialog &other)=delete
void rbtnGroupClicked(int id) noexcept
Definition: gridsettingsdialog.cpp:95
void buttonBoxClicked(QAbstractButton *button) noexcept
Definition: gridsettingsdialog.cpp:116
Definition: occmodel.cpp:77
type_safe::constrained_type< Length, PositiveLengthConstraint, PositiveLengthVerifier > PositiveLength
Definition: length.h:812
Definition: gridsettingsdialog.h:84
PositiveLength interval
Definition: gridsettingsdialog.h:85
Theme::GridStyle style
Definition: gridsettingsdialog.h:87
LengthUnit unit
Definition: gridsettingsdialog.h:86