QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
elementpropertieseditorwidget.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 ELEMENTPROPERTIESEDITORWIDGET_H
19#define ELEMENTPROPERTIESEDITORWIDGET_H
20
23
24#include <QAbstractButton>
25#include <QDialog>
26
27class QTableWidget;
28class QSpinBox;
29class QCheckBox;
30class QGroupBox;
31class QPushButton;
32class QLineEdit;
33class QScrollBar;
34
35namespace Ui {
36 class ElementPropertiesEditorWidget;
37}
38
44class ElementPropertiesEditorWidget : public QDialog
45{
46 Q_OBJECT
47
48 //METHODS
49 public:
50 explicit ElementPropertiesEditorWidget(ElementData data, QWidget *parent = nullptr);
52
54
55 private:
56 void upDateInterface();
57 void setUpInterface();
58 void updateTree();
59 void populateTree();
63 void populatePlcTable();
64 void readPlcTable();
65
66 //SLOTS
67 private slots:
70 void on_m_slave_groups_checkbox_toggled(bool checked);
71 void on_max_slaves_checkbox_toggled(bool checked);
72 void plcAddRow();
73 void plcRemoveRow();
75 void plcTerminalCountChanged(int row, int count);
77 void plcSelectCellFont();
78 void plcSetCellFromValue(int row, int col, const QString &val);
79
80 //ATTRIBUTES
81 private:
82 Ui::ElementPropertiesEditorWidget *ui;
84
85 // PLC configuration widgets (created programmatically)
86 QGroupBox *m_plc_gb = nullptr;
87 QTableWidget *m_plc_table = nullptr;
88 QTableWidget *m_plc_terminal_table = nullptr;
89 QCheckBox *m_plc_break_checkboxes[4] = {nullptr, nullptr, nullptr, nullptr};
90 QSpinBox *m_plc_break_spinboxes[4] = {nullptr, nullptr, nullptr, nullptr};
91 QSpinBox *m_plc_row_height_spinbox = nullptr;
92 QPushButton *m_plc_header_font_btn = nullptr;
93 QPushButton *m_plc_cell_font_btn = nullptr;
94 QCheckBox *m_plc_show_headers_cb = nullptr;
98 QList<QSpinBox *> m_plc_col_width_spinboxes;
99 QList<QLineEdit *> m_plc_col_name_edits;
100 QScrollBar *m_plc_shared_scrollbar = nullptr;
101 bool m_plc_scroll_sync = false;
102};
103
104#endif // ELEMENTPROPERTIESEDITORWIDGET_H
The ElementData class WARNING This class inherit from PropertiesInterface but only fromXml is actuall...
Definition elementdata.h:36
QFont m_plc_cell_font
Definition elementpropertieseditorwidget.h:96
void upDateInterface()
ElementPropertiesEditorWidget::upDateInterface Update the interface with the current value.
Definition elementpropertieseditorwidget.cpp:103
QTableWidget * m_plc_terminal_table
Definition elementpropertieseditorwidget.h:88
QSpinBox * m_plc_break_spinboxes[4]
Definition elementpropertieseditorwidget.h:90
void plcSelectHeaderFont()
ElementPropertiesEditorWidget::plcSelectHeaderFont Open font dialog to select column header font.
Definition elementpropertieseditorwidget.cpp:1326
QGroupBox * m_plc_gb
Definition elementpropertieseditorwidget.h:86
void setUpInterface()
ElementPropertiesEditorWidget::setUpInterface.
Definition elementpropertieseditorwidget.cpp:182
ElementData editedData()
Definition elementpropertieseditorwidget.h:53
void on_max_slaves_checkbox_toggled(bool checked)
ElementPropertiesEditorWidget::on_max_slaves_checkbox_toggled When max_slaves checkbox is unchecked,...
Definition elementpropertieseditorwidget.cpp:437
QTableWidget * m_plc_table
Definition elementpropertieseditorwidget.h:87
void plcTerminalCountChanged(int row, int count)
ElementPropertiesEditorWidget::plcTerminalCountChanged Enable/disable T1-T4 cells and grow columns ba...
Definition elementpropertieseditorwidget.cpp:1158
QFont m_plc_header_font
Definition elementpropertieseditorwidget.h:95
void plcSelectCellFont()
ElementPropertiesEditorWidget::plcSelectCellFont Open font dialog to select cell text font.
Definition elementpropertieseditorwidget.cpp:1342
void plcRemoveRow()
ElementPropertiesEditorWidget::plcRemoveRow Remove selected rows from the PLC IO table.
Definition elementpropertieseditorwidget.cpp:1211
QScrollBar * m_plc_shared_scrollbar
Definition elementpropertieseditorwidget.h:100
ElementData m_data
Definition elementpropertieseditorwidget.h:83
void on_m_buttonBox_accepted()
ElementPropertiesEditorWidget::on_m_buttonBox_accepted Action on button accepted : the new informatio...
Definition elementpropertieseditorwidget.cpp:354
void plcAddRow()
ElementPropertiesEditorWidget::plcAddRow Add a new empty row to the PLC IO table.
Definition elementpropertieseditorwidget.cpp:1101
QList< QCheckBox * > m_plc_col_visibility_checkboxes
Definition elementpropertieseditorwidget.h:97
void plcPasteFromClipboard()
ElementPropertiesEditorWidget::plcPasteFromClipboard Paste IO data from clipboard (tab-separated,...
Definition elementpropertieseditorwidget.cpp:1235
void readPlcTable()
ElementPropertiesEditorWidget::readPlcTable Read the PLC data from the table back into m_data.
Definition elementpropertieseditorwidget.cpp:1012
void readSlaveGroupsFromTable()
ElementPropertiesEditorWidget::readSlaveGroupsFromTable Read the slave contact groups from the table ...
Definition elementpropertieseditorwidget.cpp:590
bool m_plc_scroll_sync
Definition elementpropertieseditorwidget.h:101
Ui::ElementPropertiesEditorWidget * ui
Definition elementpropertieseditorwidget.h:82
QPushButton * m_plc_header_font_btn
Definition elementpropertieseditorwidget.h:92
void populateSlaveGroupsTable()
ElementPropertiesEditorWidget::populateSlaveGroupsTable Fill the slave contact groups table from m_da...
Definition elementpropertieseditorwidget.cpp:469
QPushButton * m_plc_cell_font_btn
Definition elementpropertieseditorwidget.h:93
void plcSetCellFromValue(int row, int col, const QString &val)
ElementPropertiesEditorWidget::plcSetCellFromValue Set a single table cell value, respecting the colu...
Definition elementpropertieseditorwidget.cpp:1291
void on_m_slave_groups_checkbox_toggled(bool checked)
ElementPropertiesEditorWidget::on_m_slave_groups_checkbox_toggled When slave groups checkbox is toggl...
Definition elementpropertieseditorwidget.cpp:449
QCheckBox * m_plc_break_checkboxes[4]
Definition elementpropertieseditorwidget.h:89
QList< QLineEdit * > m_plc_col_name_edits
Definition elementpropertieseditorwidget.h:99
QCheckBox * m_plc_show_headers_cb
Definition elementpropertieseditorwidget.h:94
void populateTree()
ElementPropertiesEditorWidget::populateTree Create QTreeWidgetItem of the tree widget and populate it...
Definition elementpropertieseditorwidget.cpp:310
~ElementPropertiesEditorWidget() override
ElementPropertiesEditorWidget::~ElementPropertiesEditorWidget Default destructor.
Definition elementpropertieseditorwidget.cpp:94
void on_m_base_type_cb_currentIndexChanged(int index)
ElementPropertiesEditorWidget::on_m_base_type_cb_currentIndexChanged.
Definition elementpropertieseditorwidget.cpp:410
QSpinBox * m_plc_row_height_spinbox
Definition elementpropertieseditorwidget.h:91
void updateTree()
Definition elementpropertieseditorwidget.cpp:271
void createPlcConfigWidgets()
ElementPropertiesEditorWidget::createPlcConfigWidgets Create the PLC configuration widgets programmat...
Definition elementpropertieseditorwidget.cpp:651
ElementPropertiesEditorWidget(ElementData data, QWidget *parent=nullptr)
ElementPropertiesEditorWidget::ElementPropertiesEditorWidget.
Definition elementpropertieseditorwidget.cpp:80
QList< QSpinBox * > m_plc_col_width_spinboxes
Definition elementpropertieseditorwidget.h:98
void populatePlcTable()
ElementPropertiesEditorWidget::populatePlcTable Fill the PLC table from m_data.
Definition elementpropertieseditorwidget.cpp:873
Definition autonumberingdockwidget.h:30