QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
contactgroupselectiondialog.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 CONTACTGROUPSELECTIONDIALOG_H
19#define CONTACTGROUPSELECTIONDIALOG_H
20
21#include <QDialog>
22#include <QVector>
23#include <QSet>
24
26
27class QTableWidget;
28class QTableWidgetItem;
29class QPushButton;
30
37class ContactGroupSelectionDialog : public QDialog
38{
39 Q_OBJECT
40
41 public:
43 const QVector<ElementData::SlaveContactGroup> &groups,
44 const QSet<int> &usedGroupIndices,
45 const ElementData &slaveData,
46 QWidget *parent = nullptr);
47
48 int selectedIndex() const;
49
50 private:
51 QTableWidget *m_table = nullptr;
52 QPushButton *m_ok_button = nullptr;
54 QSet<int> m_used_indices;
55 QSet<int> m_disabled_rows;
56
57 static QString typeToString(ElementData::SlaveState type);
58 static QString subtypeToString(ElementData::SlaveType subtype);
59};
60
61#endif // CONTACTGROUPSELECTIONDIALOG_H
ContactGroupSelectionDialog(const QVector< ElementData::SlaveContactGroup > &groups, const QSet< int > &usedGroupIndices, const ElementData &slaveData, QWidget *parent=nullptr)
Definition contactgroupselectiondialog.cpp:28
static QString subtypeToString(ElementData::SlaveType subtype)
Definition contactgroupselectiondialog.cpp:228
QSet< int > m_disabled_rows
Definition contactgroupselectiondialog.h:55
int selectedIndex() const
Definition contactgroupselectiondialog.cpp:212
static QString typeToString(ElementData::SlaveState type)
Definition contactgroupselectiondialog.cpp:217
QSet< int > m_used_indices
Definition contactgroupselectiondialog.h:54
QTableWidget * m_table
Definition contactgroupselectiondialog.h:51
int m_selected_index
Definition contactgroupselectiondialog.h:53
QPushButton * m_ok_button
Definition contactgroupselectiondialog.h:52
The ElementData class WARNING This class inherit from PropertiesInterface but only fromXml is actuall...
Definition elementdata.h:36
SlaveState
Definition elementdata.h:71
SlaveType
Definition elementdata.h:61