QElectroTech  0.8-dev
conductorpropertieswidget.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 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 CONDUCTORPROPERTIESWIDGET_H
19 #define CONDUCTORPROPERTIESWIDGET_H
20 
21 #include <QWidget>
22 #include "conductorproperties.h"
24 class QComboBox;
25 class QPushButton;
26 
27 namespace Ui {
29 }
30 
31 class ConductorPropertiesWidget : public QWidget
32 {
33  Q_OBJECT
34 
35  public:
36  explicit ConductorPropertiesWidget(QWidget *parent = nullptr);
39  QWidget *parent = nullptr);
40  ~ConductorPropertiesWidget() override;
41 
42  //METHODS
45  void setReadOnly(const bool &ro);
46 
47  void addAutonumWidget (QWidget *widget);
48  void setHiddenOneTextPerFolio (const bool &hide);
49  void setDisabledShowText (const bool &disable = true);
50  void setHiddenAvailableAutonum (const bool &hide);
51  QComboBox *autonumComboBox() const;
52  QPushButton *editAutonumPushButton() const;
53 
54  private:
55  void initWidget();
57 
58  protected:
59  bool event(QEvent *event) override;
60 
61  //SLOTS
62  public slots:
63  void updatePreview(bool b = true);
64 
65  private slots:
66  void on_m_earth_cb_toggled(bool checked);
67  void on_m_neutral_cb_toggled(bool checked);
69 
70  private:
71  Ui::ConductorPropertiesWidget *ui;
74 };
75 
76 #endif // CONDUCTORPROPERTIESWIDGET_H
ConductorProperties::m_show_text
bool m_show_text
Definition: conductorproperties.h:103
ConductorPropertiesWidget::editAutonumPushButton
QPushButton * editAutonumPushButton() const
Definition: conductorpropertieswidget.cpp:214
ConductorPropertiesWidget::addAutonumWidget
void addAutonumWidget(QWidget *widget)
ConductorPropertiesWidget::addAutonumWidget.
Definition: conductorpropertieswidget.cpp:177
ConductorProperties::Multi
@ Multi
Definition: conductorproperties.h:79
SingleLineProperties::isPen
bool isPen() const
Definition: conductorproperties.cpp:55
ConductorPropertiesWidget
Definition: conductorpropertieswidget.h:32
ConductorProperties::m_one_text_per_folio
bool m_one_text_per_folio
Definition: conductorproperties.h:104
ConductorPropertiesWidget::on_m_earth_cb_toggled
void on_m_earth_cb_toggled(bool checked)
ConductorPropertiesWidget::on_m_earth_cb_toggled Update the widget when toggled.
Definition: conductorpropertieswidget.cpp:287
ConductorProperties::color
QColor color
Definition: conductorproperties.h:85
SingleLineProperties::phasesCount
unsigned short int phasesCount()
Definition: conductorproperties.cpp:46
ConductorProperties::style
Qt::PenStyle style
Definition: conductorproperties.h:110
ConductorPropertiesWidget::m_horiz_select
QTextOrientationSpinBoxWidget * m_horiz_select
Definition: conductorpropertieswidget.h:73
ConductorProperties::text_color
QColor text_color
Definition: conductorproperties.h:87
QETApp::createTextOrientationSpinBoxWidget
static QTextOrientationSpinBoxWidget * createTextOrientationSpinBoxWidget()
QETApp::createTextOrientationSpinBoxWidget Instantiates a QTextOrientationSpinBoxWidget and configure...
Definition: qetapp.cpp:1272
ConductorPropertiesWidget::setHiddenAvailableAutonum
void setHiddenAvailableAutonum(const bool &hide)
ConductorPropertiesWidget::setHiddenAvailableAutonum Hide the label, combo box and push button of ava...
Definition: conductorpropertieswidget.cpp:202
ConductorPropertiesWidget::ConductorPropertiesWidget
ConductorPropertiesWidget(QWidget *parent=nullptr)
ConductorPropertiesWidget::ConductorPropertiesWidget Constructor.
Definition: conductorpropertieswidget.cpp:29
SingleLineProperties::is_pen
bool is_pen
Protective Earth Neutral: visually merge neutral and ground.
Definition: conductorproperties.h:50
ConductorPropertiesWidget::event
bool event(QEvent *event) override
ConductorPropertiesWidget::event.
Definition: conductorpropertieswidget.cpp:156
ConductorPropertiesWidget::setDisabledShowText
void setDisabledShowText(const bool &disable=true)
ConductorPropertiesWidget::setDisabledShowText.
Definition: conductorpropertieswidget.cpp:193
ConductorPropertiesWidget::setConductorType
void setConductorType(ConductorProperties::ConductorType type)
ConductorPropertiesWidget::setConductorType Update this widget to the new conductor type.
Definition: conductorpropertieswidget.cpp:246
ConductorProperties::verti_rotate_text
double verti_rotate_text
Definition: conductorproperties.h:100
qetapp.h
ConductorProperties::m_dash_size
int m_dash_size
Definition: conductorproperties.h:97
ConductorPropertiesWidget::initWidget
void initWidget()
ConductorPropertiesWidget::initWidget.
Definition: conductorpropertieswidget.cpp:222
ConductorPropertiesWidget::on_m_update_preview_pb_clicked
void on_m_update_preview_pb_clicked()
ConductorPropertiesWidget::on_m_update_preview_pb_clicked Update the preview of single line....
Definition: conductorpropertieswidget.cpp:311
SingleLineProperties::setPhasesCount
void setPhasesCount(int)
Definition: conductorproperties.cpp:41
ConductorProperties::type
ConductorType type
Definition: conductorproperties.h:83
qtextorientationspinboxwidget.h
ConductorPropertiesWidget::setHiddenOneTextPerFolio
void setHiddenOneTextPerFolio(const bool &hide)
ConductorPropertiesWidget::setHiddenOneTextPerFolio.
Definition: conductorpropertieswidget.cpp:185
ConductorProperties::text_size
int text_size
Definition: conductorproperties.h:96
ConductorPropertiesWidget::m_verti_select
QTextOrientationSpinBoxWidget * m_verti_select
Definition: conductorpropertieswidget.h:73
ConductorPropertiesWidget::updatePreview
void updatePreview(bool b=true)
ConductorPropertiesWidget::updatePreview Update the preview for single lien.
Definition: conductorpropertieswidget.cpp:266
ConductorProperties::singleLineProperties
SingleLineProperties singleLineProperties
Definition: conductorproperties.h:112
QTextOrientationSpinBoxWidget
Definition: qtextorientationspinboxwidget.h:27
ConductorPropertiesWidget::setProperties
void setProperties(const ConductorProperties &properties)
ConductorPropertiesWidget::setProperties Set the properties.
Definition: conductorpropertieswidget.cpp:71
ConductorPropertiesWidget::setReadOnly
void setReadOnly(const bool &ro)
ConductorPropertiesWidget::setReadOnly.
Definition: conductorpropertieswidget.cpp:169
ConductorPropertiesWidget::on_m_neutral_cb_toggled
void on_m_neutral_cb_toggled(bool checked)
ConductorPropertiesWidget::on_m_neutral_cb_toggled Update the widget when toggled.
Definition: conductorpropertieswidget.cpp:298
ConductorProperties::m_vertical_alignment
Qt::Alignment m_vertical_alignment
Definition: conductorproperties.h:108
SingleLineProperties::draw
void draw(QPainter *, QET::ConductorSegmentType, const QRectF &)
Definition: conductorproperties.cpp:65
ConductorProperties::m_function
QString m_function
Definition: conductorproperties.h:90
ConductorPropertiesWidget::~ConductorPropertiesWidget
~ConductorPropertiesWidget() override
ConductorPropertiesWidget::~ConductorPropertiesWidget destructor.
Definition: conductorpropertieswidget.cpp:61
conductorproperties.h
ConductorProperties::horiz_rotate_text
double horiz_rotate_text
Definition: conductorproperties.h:101
ConductorProperties::m_horizontal_alignment
Qt::Alignment m_horizontal_alignment
Definition: conductorproperties.h:107
ConductorProperties::ConductorType
ConductorType
The ConductorType enum Represents the kind of a particular conductor: Single: singleline symbols,...
Definition: conductorproperties.h:79
Ui
Definition: autonumberingdockwidget.h:25
ConductorPropertiesWidget::properties
ConductorProperties properties() const
ConductorPropertiesWidget::properties.
Definition: conductorpropertieswidget.cpp:116
ConductorProperties::m_color_2
QColor m_color_2
Definition: conductorproperties.h:86
ConductorProperties::cond_size
double cond_size
Definition: conductorproperties.h:99
ConductorProperties::m_formula
QString m_formula
Definition: conductorproperties.h:94
QET::Icons::ro
QIcon ro
Definition: qeticons.cpp:200
SingleLineProperties::hasNeutral
bool hasNeutral
Whether the singleline conductor should display the neutral symbol.
Definition: conductorproperties.h:48
ConductorProperties
The ConductorProperties class This class represents the functional properties of a particular conduct...
Definition: conductorproperties.h:68
ConductorProperties::Single
@ Single
Definition: conductorproperties.h:79
ConductorPropertiesWidget::autonumComboBox
QComboBox * autonumComboBox() const
Definition: conductorpropertieswidget.cpp:209
QET::Horizontal
@ Horizontal
Horizontal segment.
Definition: qet.h:89
ConductorProperties::m_bicolor
bool m_bicolor
Definition: conductorproperties.h:105
ConductorProperties::m_wire_color
QString m_wire_color
Definition: conductorproperties.h:92
ConductorPropertiesWidget::m_properties
ConductorProperties m_properties
Definition: conductorpropertieswidget.h:72
conductorpropertieswidget.h
ConductorProperties::text
QString text
Definition: conductorproperties.h:89
SingleLineProperties::hasGround
bool hasGround
Whether the singleline conductor should display the ground symbol.
Definition: conductorproperties.h:46
ConductorProperties::m_tension_protocol
QString m_tension_protocol
Definition: conductorproperties.h:91
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
ConductorProperties::m_wire_section
QString m_wire_section
Definition: conductorproperties.h:93
ConductorPropertiesWidget::ui
Ui::ConductorPropertiesWidget * ui
Definition: conductorpropertieswidget.h:71