QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
customelementinfopartwidget.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 CUSTOMELEMENTINFOPARTWIDGET_H
19#define CUSTOMELEMENTINFOPARTWIDGET_H
20
21#include <QWidget>
22
23class QLineEdit;
24class QToolButton;
25
33class CustomElementInfoPartWidget : public QWidget
34{
35 Q_OBJECT
36
37 public:
39 const QString &key = QString(),
40 const QString &value = QString(),
41 QWidget *parent = nullptr);
43
44 QString key() const;
45 QString value() const;
46 bool hasValidKey() const;
47
48 signals:
49 void changed();
51
52 private slots:
53 void validateKey();
54
55 private:
56 QLineEdit *m_key_edit;
57 QLineEdit *m_value_edit;
58 QToolButton *m_remove_button;
59};
60
61#endif // CUSTOMELEMENTINFOPARTWIDGET_H
QString key() const
Definition customelementinfopartwidget.cpp:77
QToolButton * m_remove_button
Definition customelementinfopartwidget.h:58
QString value() const
Definition customelementinfopartwidget.cpp:85
QLineEdit * m_value_edit
Definition customelementinfopartwidget.h:57
~CustomElementInfoPartWidget() override
Definition customelementinfopartwidget.cpp:70
CustomElementInfoPartWidget(const QString &key=QString(), const QString &value=QString(), QWidget *parent=nullptr)
CustomElementInfoPartWidget::CustomElementInfoPartWidget Constructor.
Definition customelementinfopartwidget.cpp:34
void removeRequested(CustomElementInfoPartWidget *self)
QLineEdit * m_key_edit
Definition customelementinfopartwidget.h:56
bool hasValidKey() const
Definition customelementinfopartwidget.cpp:94
void validateKey()
CustomElementInfoPartWidget::validateKey Flag the key field when it doesn't match the accepted format...
Definition customelementinfopartwidget.cpp:105