QElectroTech  0.8-dev
newelementwizard.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 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 = Qt::Widget);
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
ElementsLocation::exist
bool exist() const
ElementsLocation::exist.
Definition: elementslocation.cpp:472
NewElementWizard
Definition: newelementwizard.h:39
NewElementWizard::validStep2
bool validStep2()
NewElementWizard::validStep2 Valid the step 2.
Definition: newelementwizard.cpp:205
qfilenameedit.h
NamesList::addName
void addName(const QString &, const QString &)
Definition: nameslist.cpp:43
NameListWidget::isEmpty
bool isEmpty() const
NameListWidget::isEmpty.
Definition: namelistwidget.cpp:125
NewElementWizard::m_tree_view
QTreeView * m_tree_view
Definition: newelementwizard.h:58
NewElementWizard::validStep1
bool validStep1()
NewElementWizard::validStep1 Valid the setp 1.
Definition: newelementwizard.cpp:173
NewElementWizard::NewElementWizard
NewElementWizard(QWidget *=nullptr, Qt::WindowFlags=Qt::Widget)
Definition: newelementwizard.cpp:31
elementscollectionmodel.h
QFileNameEdit
Definition: qfilenameedit.h:32
ElementCollectionItem::collectionPath
virtual QString collectionPath() const =0
NewElementWizard::m_chosen_file
QString m_chosen_file
Definition: newelementwizard.h:57
elementcollectionitem.h
qetmessagebox.h
NewElementWizard::m_model
ElementsCollectionModel * m_model
Definition: newelementwizard.h:60
ElementCollectionItem
The ElementCollectionItem class This class represent a item (a directory or an element) in a element ...
Definition: elementcollectionitem.h:30
NewElementWizard::Names
@ Names
Definition: newelementwizard.h:54
qetelementeditor.h
NewElementWizard::m_qle_filename
QFileNameEdit * m_qle_filename
Definition: newelementwizard.h:55
NewElementWizard::createNewElement
void createNewElement()
NewElementWizard::createNewElement Lauch an element editor for create the new element.
Definition: newelementwizard.cpp:236
ElementCollectionItem::isDir
virtual bool isDir() const =0
NewElementWizard::m_chosen_location
ElementsLocation m_chosen_location
Definition: newelementwizard.h:59
ElementsCollectionModel::addCustomCollection
void addCustomCollection(bool set_data=true)
ElementsCollectionModel::addCustomCollection Add the custom elements collection to this model.
Definition: elementscollectionmodel.cpp:316
NewElementWizard::WizardState
WizardState
Definition: newelementwizard.h:54
ElementsLocation::addToPath
bool addToPath(const QString &)
ElementsLocation::addToPath Add a string to the actual path of this location.
Definition: elementslocation.cpp:320
ElementsCollectionModel::hideElement
void hideElement()
ElementsCollectionModel::hideElement Hide element in this model, only directory is managed.
Definition: elementscollectionmodel.cpp:526
elementslocation.h
NewElementWizard::buildStep3
QWizardPage * buildStep3()
NewElementWizard::buildStep3.
Definition: newelementwizard.cpp:126
NewElementWizard::preselectedLocation
void preselectedLocation(const ElementsLocation &location)
NewElementWizard::preselectedLocation Select item in the tree view represented by location,...
Definition: newelementwizard.cpp:62
NewElementWizard::Category
@ Category
Definition: newelementwizard.h:54
NewElementWizard::buildStep1
QWizardPage * buildStep1()
NewElementWizard::buildStep1.
Definition: newelementwizard.cpp:75
NewElementWizard::m_names_list
NameListWidget * m_names_list
Definition: newelementwizard.h:56
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
ElementsCollectionModel::indexFromLocation
QModelIndex indexFromLocation(const ElementsLocation &location)
ElementsCollectionModel::indexFromLocation Return the index who represent location....
Definition: elementscollectionmodel.cpp:543
newelementwizard.h
NamesList
Definition: nameslist.h:30
NewElementWizard::~NewElementWizard
~NewElementWizard() override
Definition: newelementwizard.cpp:54
ElementsCollectionModel
Definition: elementscollectionmodel.h:32
NewElementWizard::validateCurrentPage
bool validateCurrentPage() override
NewElementWizard::validateCurrentPage.
Definition: newelementwizard.cpp:147
NewElementWizard::Filename
@ Filename
Definition: newelementwizard.h:54
NameListWidget
The NameListWidget class Provide a widget for let user define localized string;.
Definition: namelistwidget.h:33
NewElementWizard::NewElementWizard
NewElementWizard(const NewElementWizard &)
QET::QetMessageBox::critical
QMessageBox::StandardButton critical(QWidget *, const QString &, const QString &, QMessageBox::StandardButtons=QMessageBox::Ok, QMessageBox::StandardButton=QMessageBox::NoButton)
Definition: qetmessagebox.cpp:23
namelistwidget.h
NewElementWizard::buildStep2
QWizardPage * buildStep2()
NewElementWizard::buildStep2.
Definition: newelementwizard.cpp:102
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
QETElementEditor
Definition: qetelementeditor.h:33