QElectroTech  0.70
numparteditorw.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 NUMPARTEDITORW_H
19 #define NUMPARTEDITORW_H
20 
21 #include <QWidget>
22 #include <QValidator>
23 #include "numerotationcontext.h"
24 
30 namespace Ui {
31  class NumPartEditorW;
32 }
33 
34 class NumPartEditorW : public QWidget
35 {
36  Q_OBJECT
37 
38  //METHODS
39  public:
40  explicit NumPartEditorW(int type, QWidget *parent = nullptr);
41  NumPartEditorW (NumerotationContext &, int, int type, QWidget *parent=nullptr);
42  ~NumPartEditorW() override;
43 
47  };
49  bool isValid ();
51 
52  private:
53  void setVisibleItems();
54  void disableItem(int index);
56 
57  private slots:
58  void on_type_cb_activated(int);
61  void setType (NumPartEditorW::type t, bool=false);
62 
63  signals:
64  void changed ();
65 
66  private:
67  Ui::NumPartEditorW *ui;
68  QValidator *intValidator;
69  int m_edited_type = -1; //0 == element : 1 == conductor : 2 == folio
70 
71 
72 
73 };
74 
75 #endif // NUMPARTEDITORW_H
~NumPartEditorW() override
NumPartEditorW(int type, QWidget *parent=nullptr)
QValidator * intValidator
void on_type_cb_activated(int)
NumPartEditorW::on_type_cb_activated Action when user change the type comboBox.
bool isValid()
NumPartEditorW::isValid.
void disableItem(int index)
NumerotationContext toNumContext()
NumPartEditorW::toNumContext.
void setType(NumPartEditorW::type t, bool=false)
NumPartEditorW::setType Set good behavior by type .
void on_increase_spinBox_valueChanged(int)
NumPartEditorW::on_increase_spinBox_valueChanged emit changed when value changed.
Ui::NumPartEditorW * ui
void setCurrentIndex(NumPartEditorW::type)
NumPartEditorW::setCurrentIndex Set Current Index of type_cb.
void on_value_field_textEdited()
NumPartEditorW::on_value_field_textChanged emit changed when text changed.