LibrePCB Developers Documentation
Loading...
Searching...
No Matches
checkableitemseditorwidget.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_CHECKABLEITEMSEDITORWIDGET_H
21
#define LIBREPCB_EDITOR_CHECKABLEITEMSEDITORWIDGET_H
22
23
/*******************************************************************************
24
* Includes
25
******************************************************************************/
26
#include <QtCore>
27
#include <QtWidgets>
28
29
/*******************************************************************************
30
* Namespace / Forward Declarations
31
******************************************************************************/
32
namespace
librepcb
{
33
namespace
editor {
34
35
/*******************************************************************************
36
* Class CheckableItemsEditorWidget
37
******************************************************************************/
38
44
class
CheckableItemsEditorWidget
final :
public
QFrame {
45
Q_OBJECT
46
47
public
:
49
typedef
std::tuple<QVariant, QString, Qt::CheckState>
Item
;
50
typedef
QVector<Item>
ItemList
;
51
52
// Constructors / Destructor
53
CheckableItemsEditorWidget
() =
delete
;
54
explicit
CheckableItemsEditorWidget
(QWidget* parent =
nullptr
) noexcept;
55
CheckableItemsEditorWidget
(const
CheckableItemsEditorWidget
& other) = delete;
56
~
CheckableItemsEditorWidget
() noexcept;
57
58
// General Methods
59
const
ItemList
&
getItems
() const noexcept {
return
mItems
; }
60
void
setItems
(
const
ItemList
& items)
noexcept
;
61
62
// Operator Overloadings
63
CheckableItemsEditorWidget
&
operator=
(
const
CheckableItemsEditorWidget
& rhs) =
64
delete
;
65
66
private
:
// Methods
67
void
updateWidgets
() noexcept;
68
69
private:
// Data
70
QPointer<QVBoxLayout>
mLayout
;
71
ItemList
mItems
;
72
};
73
74
/*******************************************************************************
75
* End of File
76
******************************************************************************/
77
78
}
// namespace editor
79
}
// namespace librepcb
80
81
Q_DECLARE_METATYPE(
librepcb
::editor::
CheckableItemsEditorWidget
::
Item
)
82
Q_DECLARE_METATYPE(
librepcb
::editor::
CheckableItemsEditorWidget
::
ItemList
)
83
84
#endif
librepcb::editor::CheckableItemsEditorWidget
A widget to modify a list of checkable string items.
Definition
checkableitemseditorwidget.h:44
librepcb::editor::CheckableItemsEditorWidget::setItems
void setItems(const ItemList &items) noexcept
Definition
checkableitemseditorwidget.cpp:60
librepcb::editor::CheckableItemsEditorWidget::updateWidgets
void updateWidgets() noexcept
Definition
checkableitemseditorwidget.cpp:69
librepcb::editor::CheckableItemsEditorWidget::CheckableItemsEditorWidget
CheckableItemsEditorWidget()=delete
librepcb::editor::CheckableItemsEditorWidget::ItemList
QVector< Item > ItemList
Definition
checkableitemseditorwidget.h:50
librepcb::editor::CheckableItemsEditorWidget::Item
std::tuple< QVariant, QString, Qt::CheckState > Item
Key, text, check state.
Definition
checkableitemseditorwidget.h:49
librepcb::editor::CheckableItemsEditorWidget::mLayout
QPointer< QVBoxLayout > mLayout
Definition
checkableitemseditorwidget.h:70
librepcb::editor::CheckableItemsEditorWidget::operator=
CheckableItemsEditorWidget & operator=(const CheckableItemsEditorWidget &rhs)=delete
librepcb::editor::CheckableItemsEditorWidget::getItems
const ItemList & getItems() const noexcept
Definition
checkableitemseditorwidget.h:59
librepcb::editor::CheckableItemsEditorWidget::mItems
ItemList mItems
Definition
checkableitemseditorwidget.h:71
librepcb
Definition
occmodel.cpp:76
libs
librepcb
editor
widgets
checkableitemseditorwidget.h
Generated on Wed Dec 18 2024 20:12:49 for LibrePCB Developers Documentation by
1.9.8