QElectroTech  0.70
potentialselectordialog.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 POTENTIALSELECTORDIALOG_H
19 #define POTENTIALSELECTORDIALOG_H
20 
21 #include <QDialog>
22 #include "conductorproperties.h"
23 #include "assignvariables.h"
24 class Conductor;
25 class QUndoCommand;
26 class Element;
27 
29 {
30  public:
33  virtual bool isValid() const = 0;
34 
37  QList<ConductorProperties> m_properties_list_1, m_properties_list_2;
39 };
40 
41 namespace Ui {
43 }
44 
60 class PotentialSelectorDialog : public QDialog
61 {
62  Q_OBJECT
63 
64  public:
65  static ConductorProperties chosenProperties(QList<ConductorProperties> list, QWidget *parent = nullptr);
66 
67  public:
68  explicit PotentialSelectorDialog(Conductor *conductor, QUndoCommand *parent_undo = nullptr, QWidget *parent = nullptr);
69  explicit PotentialSelectorDialog(Element *report, QUndoCommand *parent_undo = nullptr, QWidget *parent = nullptr);
70  ~PotentialSelectorDialog() override;
71 
72 
73  private slots:
74  void on_buttonBox_accepted();
75 
76  private:
77  void buildWidget();
78 
79  private:
80  Ui::PotentialSelectorDialog *ui;
83  QUndoCommand *m_parent_undo;
86  QList <ConductorProperties> m_properties_list;
87  QList <Conductor *> m_conductors_to_change;
88  int m_selected = 0;
89 };
90 #endif // POTENTIALSELECTORDIALOG_H
QList< ConductorProperties > m_properties_list_1
autonum::sequentialNumbers m_seq_num_2
void on_buttonBox_accepted()
PotentialSelectorDialog::on_buttonBox_accepted Action when user click on OK button.
autonum::sequentialNumbers m_sequential_num
AbstractPotentialSelector * m_potential_selector
QList< Conductor * > m_conductors_list_2
PotentialSelectorDialog(Conductor *conductor, QUndoCommand *parent_undo=nullptr, QWidget *parent=nullptr)
PotentialSelectorDialog::PotentialSelectorDialog Constructor when we link two potentiels together...
QList< ConductorProperties > m_properties_list
autonum::sequentialNumbers m_seq_num_1
Ui::PotentialSelectorDialog * ui
QList< Conductor * > m_conductors_to_change
The PotentialSelectorDialog class This dialog is used when user try to connect two existing potential...
QList< ConductorProperties > m_properties_list_2
static ConductorProperties chosenProperties(QList< ConductorProperties > list, QWidget *parent=nullptr)
virtual bool isValid() const =0
void buildWidget()
PotentialSelectorDialog::buildWidget Build the dialog.
QList< Conductor * > m_conductors_list_1