mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-05 18:54:14 +02:00
10bf0411bb
New QLineEdit (m_potential_le) between Type and Nom: an optional, symbol-author-chosen grouping identifier shared by terminals that belong to the same physical terminal within a multi-terminal block. Stored as TerminalData::m_potential (new field, persisted as the "potential" XML attribute, empty by default). Used by relatedPotentialTerminal() in terminal.cpp: when potential_isolating is enabled on a Terminal-type element, terminals sharing a non-empty, matching potential value now stay electrically linked to each other instead of every terminal in the block being isolated from every other one. Tooltip on the field for explanation
90 lines
2.3 KiB
C++
90 lines
2.3 KiB
C++
/*
|
|
Copyright 2006-2026 The QElectroTech Team
|
|
This file is part of QElectroTech.
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#ifndef TERMINALEDITOR_H
|
|
#define TERMINALEDITOR_H
|
|
|
|
#include <QWidget>
|
|
#include "../elementitemeditor.h"
|
|
|
|
#ifdef BUILD_WITHOUT_KF
|
|
#include <QPushButton>
|
|
#else
|
|
#include <KColorButton>
|
|
#endif
|
|
|
|
namespace Ui {
|
|
class TerminalEditor;
|
|
}
|
|
|
|
class PartTerminal;
|
|
|
|
/**
|
|
* @brief The TerminalEditor class
|
|
* Provide a widget used to edit the properties of a PartTerminal
|
|
*/
|
|
class TerminalEditor : public ElementItemEditor
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TerminalEditor(QETElementEditor *editor, QWidget *parent = nullptr);
|
|
~TerminalEditor() override;
|
|
|
|
void updateForm() override;
|
|
bool setPart(CustomElementPart *new_part) override;
|
|
CustomElementPart *currentPart() const override;
|
|
QList<CustomElementPart *> currentParts() const override {return QList<CustomElementPart *>();}
|
|
public slots:
|
|
void refreshMasterLabelVisibility();
|
|
|
|
private:
|
|
void init();
|
|
void posEdited();
|
|
void orientationEdited();
|
|
void nameEdited();
|
|
void typeEdited();
|
|
void potentialEdited();
|
|
void showNameEdited();
|
|
void labelPosEdited();
|
|
void labelFontClicked();
|
|
void labelSizeEdited();
|
|
void labelRotationEdited();
|
|
void labelAlignClicked();
|
|
void labelFrameEdited();
|
|
void labelColorClicked();
|
|
void activeConnections(bool active);
|
|
void activeChangeConnections(bool active);
|
|
void useMasterLabelEdited();
|
|
void masterLabelIndexEdited();
|
|
bool updateMasterLabelVisibility();
|
|
|
|
private:
|
|
Ui::TerminalEditor *ui;
|
|
QVector<QMetaObject::Connection> m_editor_connections,
|
|
m_change_connections;
|
|
PartTerminal *m_part = nullptr;
|
|
bool m_locked = false;
|
|
#ifdef BUILD_WITHOUT_KF
|
|
QPushButton *m_color_pb;
|
|
#else
|
|
KColorButton *m_color_pb;
|
|
#endif
|
|
};
|
|
|
|
#endif // TERMINALEDITOR_H
|