QElectroTech  0.70
elementdialog.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 ELEMENT_DIALOG_H
19 #define ELEMENT_DIALOG_H
20 
21 #include <QDialog>
22 #include "elementslocation.h"
23 
24 class QDialogButtonBox;
25 class QFileNameEdit;
26 class QTreeView;
28 
33 class ElementDialog : public QDialog
34 {
35  Q_OBJECT
36  // enumerations
40  enum {
45  };
46 
47  // constructors, destructor
48  public:
49  ElementDialog(uint = ElementDialog::OpenElement, QWidget *parent = nullptr);
50  private:
52 
53  public:
54  ElementsLocation location() const;
55 
56  private:
57  void setUpWidget();
58  void setUpConnection();
59  void indexClicked(const QModelIndex &index);
60  void updateWidget();
61  void checkCurrentLocation();
62  void checkAccept();
63 
64  // attributes
65  private:
66  uint m_mode;
68  QDialogButtonBox *m_buttons_box = nullptr;
70  QTreeView *m_tree_view = nullptr;
72 
73  public:
74  static ElementsLocation getOpenElementLocation(QWidget *parent = nullptr);
75  static ElementsLocation getSaveElementLocation(QWidget *parent = nullptr);
76  private:
77  static ElementsLocation execConfiguredDialog(int, QWidget *parent = nullptr);
78 
79 };
80 #endif
QDialogButtonBox * m_buttons_box
Definition: elementdialog.h:68
void checkCurrentLocation()
ElementDialog::checkCurrentLocation Update this dialog according to the current selected location and...
QFileNameEdit * m_text_field
Definition: elementdialog.h:69
ElementDialog(uint=ElementDialog::OpenElement, QWidget *parent=nullptr)
ElementDialog::ElementDialog.
static ElementsLocation execConfiguredDialog(int, QWidget *parent=nullptr)
ElementDialog::execConfiguredDialog launch a dialog with the chosen mode.
ElementsLocation location() const
ElementDialog::location.
void setUpWidget()
ElementDialog::setUpWidget Build and setup the widgets of this dialog.
QTreeView * m_tree_view
Definition: elementdialog.h:70
The dialog should select an element for saving.
Definition: elementdialog.h:42
The dialog should open an element.
Definition: elementdialog.h:41
ElementsCollectionModel * m_model
Definition: elementdialog.h:71
The dialog should select a category for saving.
Definition: elementdialog.h:44
void setUpConnection()
ElementDialog::setUpConnection Setup connection of this dialog.
void updateWidget()
void indexClicked(const QModelIndex &index)
ElementDialog::indexClicked.
static ElementsLocation getOpenElementLocation(QWidget *parent=nullptr)
ElementDialog::getOpenElementLocation Display a dialog for open an element through her location...
The dialog should open a category.
Definition: elementdialog.h:43
ElementsLocation m_location
Definition: elementdialog.h:67
static ElementsLocation getSaveElementLocation(QWidget *parent=nullptr)
ElementDialog::getSaveElementLocation Display a dialog that allow to user to select an element (exist...