QElectroTech  0.70
newelementwizard.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 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 NEW_ELEMENT_WIZARD_H
19 #define NEW_ELEMENT_WIZARD_H
20 
21 #include <QWizard>
22 #include "elementslocation.h"
23 
24 class NameListWidget;
25 class QFileNameEdit;
26 class QTreeView;
28 
38 class NewElementWizard : public QWizard
39 {
40  Q_OBJECT
41 
42  // constructors, destructor
43  public:
44  NewElementWizard(QWidget * = nullptr, Qt::WindowFlags = nullptr);
45  ~NewElementWizard() override;
46 
47  void preselectedLocation(const ElementsLocation &location);
48 
49  private:
51 
52  // attributes
53  private:
57  QString m_chosen_file;
58  QTreeView *m_tree_view = nullptr;
61 
62  // methods
63  private:
64  QWizardPage *buildStep1();
65  QWizardPage *buildStep2();
66  QWizardPage *buildStep3();
67  bool validStep1();
68  bool validStep2();
69  bool validateCurrentPage() override;
70  void createNewElement();
71 };
72 #endif
QWizardPage * buildStep1()
NewElementWizard::buildStep1.
NewElementWizard(QWidget *=nullptr, Qt::WindowFlags=nullptr)
QWizardPage * buildStep2()
NewElementWizard::buildStep2.
void preselectedLocation(const ElementsLocation &location)
NewElementWizard::preselectedLocation Select item in the tree view represented by location...
ElementsLocation m_chosen_location
bool validStep1()
NewElementWizard::validStep1 Valid the setp 1.
void createNewElement()
NewElementWizard::createNewElement Lauch an element editor for create the new element.
NameListWidget * m_names_list
bool validStep2()
NewElementWizard::validStep2 Valid the step 2.
QTreeView * m_tree_view
~NewElementWizard() override
QFileNameEdit * m_qle_filename
bool validateCurrentPage() override
NewElementWizard::validateCurrentPage.
ElementsCollectionModel * m_model
QWizardPage * buildStep3()
NewElementWizard::buildStep3.
The NameListWidget class Provide a widget for let user define localized string;.