QElectroTech  0.8-dev
diagramschooser.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef DIAGRAMS_CHOOSER_H
19 #define DIAGRAMS_CHOOSER_H
20 #include <QtWidgets>
21 class QETProject;
22 class Diagram;
27 class DiagramsChooser : public QScrollArea {
28  Q_OBJECT
29 
30  // constructors, destructor
31  public:
32  DiagramsChooser(QETProject *, QWidget * = nullptr);
33  ~DiagramsChooser() override;
34  private:
36 
37  // methods
38  public:
39  QETProject *project() const;
40  QList<Diagram *> selectedDiagrams() const;
41  QList<Diagram *> nonSelectedDiagrams() const;
42  bool diagramIsSelected(Diagram * const) const;
43  void setSelectedDiagrams(const QList<Diagram *> &, bool = true, bool = true);
44  void setSelectedAllDiagrams(bool = true);
45 
46  public slots:
47  void updateList();
48 
49  signals:
51 
52  private:
53  void buildLayout();
54 
55  // attributes
56  private:
58  QWidget *widget0_;
59  QVBoxLayout *vlayout0_;
60  QHash<Diagram *, QCheckBox *> diagrams_;
61 };
62 #endif
DiagramsChooser::nonSelectedDiagrams
QList< Diagram * > nonSelectedDiagrams() const
Definition: diagramschooser.cpp:77
DiagramsChooser::project_
QETProject * project_
Definition: diagramschooser.h:57
DiagramsChooser::DiagramsChooser
DiagramsChooser(const DiagramsChooser &)
DiagramsChooser::setSelectedDiagrams
void setSelectedDiagrams(const QList< Diagram * > &, bool=true, bool=true)
Definition: diagramschooser.cpp:104
DiagramsChooser::selectedDiagrams
QList< Diagram * > selectedDiagrams() const
Definition: diagramschooser.cpp:63
DiagramsChooser::diagramIsSelected
bool diagramIsSelected(Diagram *const) const
Definition: diagramschooser.cpp:90
DiagramsChooser::diagrams_
QHash< Diagram *, QCheckBox * > diagrams_
Definition: diagramschooser.h:60
DiagramsChooser::vlayout0_
QVBoxLayout * vlayout0_
Definition: diagramschooser.h:59
Diagram
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition: diagram.h:56
DiagramsChooser::project
QETProject * project() const
Definition: diagramschooser.cpp:56
qetproject.h
QETProject
Definition: qetproject.h:51
DiagramsChooser::setSelectedAllDiagrams
void setSelectedAllDiagrams(bool=true)
Definition: diagramschooser.cpp:137
DiagramsChooser::updateList
void updateList()
Definition: diagramschooser.cpp:149
DiagramsChooser::~DiagramsChooser
~DiagramsChooser() override
Definition: diagramschooser.cpp:50
DiagramsChooser::selectionChanged
void selectionChanged()
DiagramsChooser::DiagramsChooser
DiagramsChooser(QETProject *, QWidget *=nullptr)
Definition: diagramschooser.cpp:27
DiagramsChooser::buildLayout
void buildLayout()
Definition: diagramschooser.cpp:179
diagramschooser.h
DiagramsChooser
Definition: diagramschooser.h:27
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
DiagramsChooser::widget0_
QWidget * widget0_
Definition: diagramschooser.h:58
diagram.h