LibrePCB Developers Documentation
categorychooserdialog.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_CATEGORYCHOOSERDIALOG_H
21#define LIBREPCB_EDITOR_CATEGORYCHOOSERDIALOG_H
22
23/*******************************************************************************
24 * Includes
25 ******************************************************************************/
26#include "../../workspace/categorytreemodel.h"
27
29
30#include <QtCore>
31#include <QtWidgets>
32
33/*******************************************************************************
34 * Namespace / Forward Declarations
35 ******************************************************************************/
36namespace librepcb {
37
38class Workspace;
39
40namespace editor {
41
42namespace Ui {
43class CategoryChooserDialog;
44}
45
46/*******************************************************************************
47 * Class CategoryChooserDialog
48 ******************************************************************************/
49
53class CategoryChooserDialog final : public QDialog {
54 Q_OBJECT
55
56public:
58 using Filters = CategoryTreeModel::Filters;
59
60 // Constructors / Destructor
63 explicit CategoryChooserDialog(const Workspace& ws, Filters filters,
64 QWidget* parent = 0) noexcept;
65 ~CategoryChooserDialog() noexcept;
66
67 // Getters
68 tl::optional<Uuid> getSelectedCategoryUuid() const noexcept;
69
70 // Operator Overloadings
71 CategoryChooserDialog& operator=(const CategoryChooserDialog& rhs) = delete;
72
73private: // Data
74 QScopedPointer<Ui::CategoryChooserDialog> mUi;
75 QScopedPointer<CategoryTreeModel> mModel;
76};
77
78/*******************************************************************************
79 * End of File
80 ******************************************************************************/
81
82} // namespace editor
83} // namespace librepcb
84
85#endif
The Uuid class is a replacement for QUuid to get UUID strings without {} braces.
Definition: uuid.h:58
The Workspace class represents a workspace with all its data (library, projects, settings,...
Definition: workspace.h:54
The CategoryChooserDialog class.
Definition: categorychooserdialog.h:53
CategoryChooserDialog(const CategoryChooserDialog &other)=delete
tl::optional< Uuid > getSelectedCategoryUuid() const noexcept
Definition: categorychooserdialog.cpp:74
QScopedPointer< Ui::CategoryChooserDialog > mUi
Definition: categorychooserdialog.h:74
CategoryTreeModel::Filters Filters
Definition: categorychooserdialog.h:58
QScopedPointer< CategoryTreeModel > mModel
Definition: categorychooserdialog.h:75
The CategoryTreeModel class.
Definition: categorytreemodel.h:48
Filter
Definition: categorytreemodel.h:59
Definition: occmodel.cpp:77
Definition: uuid.h:183