QElectroTech  0.8-dev
templatelocationchooser.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 TITLEBLOCK_SLASH_LOCATION_CHOOSER_H
19 #define TITLEBLOCK_SLASH_LOCATION_CHOOSER_H
20 #include <QtWidgets>
21 #include "templatelocation.h"
22 class TitleBlockTemplateCollection;
23 
28 class TitleBlockTemplateLocationChooser : public QWidget {
29  Q_OBJECT
30  // Constructor, destructor
31  public:
33  QWidget * = nullptr);
35  private:
38 
39  // methods
40  public:
41  virtual TitleBlockTemplateLocation location() const;
43  virtual QString name() const;
44  virtual void setLocation(const TitleBlockTemplateLocation &);
45 
46  protected:
47  void init();
49 
50  // slots
51  protected slots:
52  virtual void updateCollections();
53  virtual void updateTemplates();
54 
55  // attributes
56  protected:
57  QFormLayout *form_layout_;
58  QComboBox *collections_;
59  QHash<int, TitleBlockTemplatesCollection *> collections_index_;
61  QComboBox *templates_;
62 };
63 #endif
TitleBlockTemplateLocationChooser::form_layout_
QFormLayout * form_layout_
Definition: templatelocationchooser.h:57
TitleBlockTemplateLocationChooser::templates_
QComboBox * templates_
Existing templates combo box.
Definition: templatelocationchooser.h:61
TitleBlockTemplateLocationChooser::name
virtual QString name() const
Definition: templatelocationchooser.cpp:62
TitleBlockTemplateLocationChooser::updateTemplates
virtual void updateTemplates()
Definition: templatelocationchooser.cpp:141
QETApp::availableTitleBlockTemplatesCollections
static QList< TitleBlockTemplatesCollection * > availableTitleBlockTemplatesCollections()
QETApp::availableTitleBlockTemplatesCollections.
Definition: qetapp.cpp:560
TitleBlockTemplateLocationChooser::location
virtual TitleBlockTemplateLocation location() const
Definition: templatelocationchooser.cpp:48
TitleBlockTemplateLocationChooser::setLocation
virtual void setLocation(const TitleBlockTemplateLocation &)
Definition: templatelocationchooser.cpp:71
TitleBlockTemplateLocationChooser::updateCollections
virtual void updateCollections()
Definition: templatelocationchooser.cpp:123
TitleBlockTemplateLocationChooser::collection
virtual TitleBlockTemplatesCollection * collection() const
Definition: templatelocationchooser.cpp:55
TitleBlockTemplateLocationChooser
Definition: templatelocationchooser.h:28
TitleBlockTemplateLocationChooser::collections_
QComboBox * collections_
Definition: templatelocationchooser.h:58
qetapp.h
TitleBlockTemplateLocationChooser::TitleBlockTemplateLocationChooser
TitleBlockTemplateLocationChooser(const TitleBlockTemplateLocation &, QWidget *=nullptr)
TitleBlockTemplateLocationChooser::TitleBlockTemplateLocationChooser Constructor.
Definition: templatelocationchooser.cpp:29
templatelocationchooser.h
TitleBlockTemplateLocation
Definition: templatelocation.h:29
templatescollection.h
qetproject.h
TitleBlockTemplateLocationChooser::indexForCollection
virtual int indexForCollection(TitleBlockTemplatesCollection *) const
TitleBlockTemplateLocationChooser::indexForCollection.
Definition: templatelocationchooser.cpp:113
TitleBlockTemplateLocation::parentCollection
TitleBlockTemplatesCollection * parentCollection() const
Definition: templatelocation.cpp:57
TitleBlockTemplatesCollection
Definition: templatescollection.h:34
templatelocation.h
TitleBlockTemplateLocationChooser::collections_index_
QHash< int, TitleBlockTemplatesCollection * > collections_index_
Collections index within the combo box.
Definition: templatelocationchooser.h:60
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
TitleBlockTemplateLocation::name
QString name() const
Definition: templatelocation.cpp:73
TitleBlockTemplateLocationChooser::TitleBlockTemplateLocationChooser
TitleBlockTemplateLocationChooser(const TitleBlockTemplateLocationChooser &)
TitleBlockTemplateLocationChooser::~TitleBlockTemplateLocationChooser
~TitleBlockTemplateLocationChooser() override
Definition: templatelocationchooser.cpp:42
TitleBlockTemplateLocationChooser::init
void init()
Definition: templatelocationchooser.cpp:90