LibrePCB Developers Documentation
keysequenceseditorwidget.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_KEYSEQUENCESEDITORWIDGET_H
21#define LIBREPCB_EDITOR_KEYSEQUENCESEDITORWIDGET_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include <optional/tl/optional.hpp>
27
28#include <QtCore>
29#include <QtWidgets>
30
31/*******************************************************************************
32 * Namespace / Forward Declarations
33 ******************************************************************************/
34namespace librepcb {
35namespace editor {
36
37/*******************************************************************************
38 * Class KeySequencesEditorWidget
39 ******************************************************************************/
40
46class KeySequencesEditorWidget final : public QWidget {
47 Q_OBJECT
48
49public:
50 // Constructors / Destructor
52 explicit KeySequencesEditorWidget(const QList<QKeySequence>& defaultSequences,
53 QWidget* parent = nullptr) noexcept;
55 ~KeySequencesEditorWidget() noexcept;
56
57 // General Methods
58 const tl::optional<QList<QKeySequence>>& getOverrides() const noexcept {
59 return mOverrides;
60 }
61 void setOverrides(
62 const tl::optional<QList<QKeySequence>>& overrides) noexcept;
63 void setRowHeight(int height) noexcept;
64
65 // Operator Overloadings
67 delete;
68
69signals:
72
73private: // Methods
74 void updateWidgets() noexcept;
75
76private: // Data
77 QPointer<QVBoxLayout> mLayout;
78 QList<QKeySequence> mDefault;
79 tl::optional<QList<QKeySequence>> mOverrides;
81};
82
83/*******************************************************************************
84 * End of File
85 ******************************************************************************/
86
87} // namespace editor
88} // namespace librepcb
89
90#endif
A widget to modify a list of QKeySequence objects.
Definition: keysequenceseditorwidget.h:46
void updateWidgets() noexcept
Definition: keysequenceseditorwidget.cpp:83
KeySequencesEditorWidget & operator=(const KeySequencesEditorWidget &rhs)=delete
tl::optional< QList< QKeySequence > > mOverrides
Definition: keysequenceseditorwidget.h:79
int mRowHeight
Definition: keysequenceseditorwidget.h:80
const tl::optional< QList< QKeySequence > > & getOverrides() const noexcept
Definition: keysequenceseditorwidget.h:58
void setOverrides(const tl::optional< QList< QKeySequence > > &overrides) noexcept
Definition: keysequenceseditorwidget.cpp:59
QList< QKeySequence > mDefault
Definition: keysequenceseditorwidget.h:78
QPointer< QVBoxLayout > mLayout
Definition: keysequenceseditorwidget.h:77
void setRowHeight(int height) noexcept
Definition: keysequenceseditorwidget.cpp:65
Definition: occmodel.cpp:77
Definition: uuid.h:183