QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
elementdialog.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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 {
47 };
48
49 // constructors, destructor
50 public:
51 ElementDialog(uint = ElementDialog::OpenElement, QWidget *parent = nullptr);
52 private:
54
55 public:
57
58 private:
59 void setUpWidget();
60 void setUpConnection();
61 void indexClicked(const QModelIndex &index);
64 void checkAccept();
65
66 // attributes
67 private:
68 uint m_mode;
70 QDialogButtonBox *m_buttons_box = nullptr;
72 QTreeView *m_tree_view = nullptr;
74
75 public:
76 static ElementsLocation getOpenElementLocation(QWidget *parent = nullptr);
77 static ElementsLocation getSaveElementLocation(QWidget *parent = nullptr);
78 static ElementsLocation getSaveTemplateLocation(QWidget *parent = nullptr);
79 private:
80 static ElementsLocation execConfiguredDialog(int, QWidget *parent = nullptr);
81
82};
83#endif
ElementsLocation m_location
Definition elementdialog.h:69
ElementsCollectionModel * m_model
Definition elementdialog.h:73
ElementsLocation location() const
ElementDialog::location.
Definition elementdialog.cpp:276
static ElementsLocation getOpenElementLocation(QWidget *parent=nullptr)
ElementDialog::getOpenElementLocation Display a dialog for open an element through her location.
Definition elementdialog.cpp:315
ElementDialog(const ElementDialog &)
void updateWidget()
void checkCurrentLocation()
ElementDialog::checkCurrentLocation Update this dialog according to the current selected location and...
Definition elementdialog.cpp:180
void checkAccept()
Definition elementdialog.cpp:219
uint m_mode
Definition elementdialog.h:68
@ SaveTemplate
The dialog should select a template for saving.
Definition elementdialog.h:46
@ 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:50
QDialogButtonBox * m_buttons_box
Definition elementdialog.h:70
void indexClicked(const QModelIndex &index)
ElementDialog::indexClicked.
Definition elementdialog.cpp:169
ElementDialog(uint=ElementDialog::OpenElement, QWidget *parent=nullptr)
ElementDialog::ElementDialog.
Definition elementdialog.cpp:38
QTreeView * m_tree_view
Definition elementdialog.h:72
static ElementsLocation getSaveTemplateLocation(QWidget *parent=nullptr)
ElementDialog::getSaveTemplateLocation Display a dialog that allow to user to select a location for s...
Definition elementdialog.cpp:335
static ElementsLocation execConfiguredDialog(int, QWidget *parent=nullptr)
ElementDialog::execConfiguredDialog launch a dialog with the chosen mode.
Definition elementdialog.cpp:346
static ElementsLocation getSaveElementLocation(QWidget *parent=nullptr)
ElementDialog::getSaveElementLocation Display a dialog that allow to user to select an element (exist...
Definition elementdialog.cpp:325
QFileNameEdit * m_text_field
Definition elementdialog.h:71
void setUpConnection()
ElementDialog::setUpConnection Setup connection of this dialog.
Definition elementdialog.cpp:156
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