QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
elementdialog.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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
22
23#include <QDialog>
24
25class QDialogButtonBox;
26class QFileNameEdit;
27class QTreeView;
29
34class ElementDialog : public QDialog
35{
36 Q_OBJECT
37 // enumerations
41 enum {
45 SaveCategory = 3
46 };
47
48 // constructors, destructor
49 public:
50 ElementDialog(uint = ElementDialog::OpenElement, QWidget *parent = nullptr);
51 private:
53
54 public:
56
57 private:
58 void setUpWidget();
59 void setUpConnection();
60 void indexClicked(const QModelIndex &index);
63 void checkAccept();
64
65 // attributes
66 private:
67 uint m_mode;
69 QDialogButtonBox *m_buttons_box = nullptr;
71 QTreeView *m_tree_view = nullptr;
73
74 public:
75 static ElementsLocation getOpenElementLocation(QWidget *parent = nullptr);
76 static ElementsLocation getSaveElementLocation(QWidget *parent = nullptr);
77 private:
78 static ElementsLocation execConfiguredDialog(int, QWidget *parent = nullptr);
79
80};
81#endif
Definition elementdialog.h:35
ElementsLocation m_location
Definition elementdialog.h:68
ElementsCollectionModel * m_model
Definition elementdialog.h:72
ElementsLocation location() const
ElementDialog::location.
Definition elementdialog.cpp:243
static ElementsLocation getOpenElementLocation(QWidget *parent=nullptr)
ElementDialog::getOpenElementLocation Display a dialog for open an element through her location.
Definition elementdialog.cpp:280
ElementDialog(const ElementDialog &)
void updateWidget()
void checkCurrentLocation()
ElementDialog::checkCurrentLocation Update this dialog according to the current selected location and...
Definition elementdialog.cpp:154
void checkAccept()
Definition elementdialog.cpp:190
uint m_mode
Definition elementdialog.h:67
@ SaveElement
The dialog should select an element for saving.
Definition elementdialog.h:43
@ SaveCategory
The dialog should select a category for saving.
Definition elementdialog.h:45
@ OpenCategory
The dialog should open a category.
Definition elementdialog.h:44
@ OpenElement
The dialog should open an element.
Definition elementdialog.h:42
void setUpWidget()
ElementDialog::setUpWidget Build and setup the widgets of this dialog.
Definition elementdialog.cpp:49
QDialogButtonBox * m_buttons_box
Definition elementdialog.h:69
void indexClicked(const QModelIndex &index)
ElementDialog::indexClicked.
Definition elementdialog.cpp:143
QTreeView * m_tree_view
Definition elementdialog.h:71
static ElementsLocation execConfiguredDialog(int, QWidget *parent=nullptr)
ElementDialog::execConfiguredDialog launch a dialog with the chosen mode.
Definition elementdialog.cpp:301
static ElementsLocation getSaveElementLocation(QWidget *parent=nullptr)
ElementDialog::getSaveElementLocation Display a dialog that allow to user to select an element (exist...
Definition elementdialog.cpp:290
QFileNameEdit * m_text_field
Definition elementdialog.h:70
void setUpConnection()
ElementDialog::setUpConnection Setup connection of this dialog.
Definition elementdialog.cpp:130
Definition elementscollectionmodel.h:33
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition elementslocation.h:47
Definition qfilenameedit.h:32