mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-04 11:30:52 +01:00
Merge branch 'XMLPropertiesNew'
This commit is contained in:
@@ -51,8 +51,8 @@ DynamicTextFieldEditor::DynamicTextFieldEditor(QETElementEditor *editor,
|
||||
DynamicTextFieldEditor::~DynamicTextFieldEditor()
|
||||
{
|
||||
delete ui;
|
||||
if(!m_connection_list.isEmpty()) {
|
||||
for(const QMetaObject::Connection& con : m_connection_list) {
|
||||
if(!m_change_connections.isEmpty()) {
|
||||
for(const QMetaObject::Connection& con : m_change_connections) {
|
||||
disconnect(con);
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ QList<CustomElementPart*> DynamicTextFieldEditor::currentParts() const
|
||||
return parts;
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::updateForm()
|
||||
void DynamicTextFieldEditor::updateFormPriv()
|
||||
{
|
||||
if(m_text_field) {
|
||||
ui -> m_x_sb -> setValue(m_text_field.data() -> x());
|
||||
@@ -182,38 +182,38 @@ void DynamicTextFieldEditor::setupWidget()
|
||||
|
||||
void DynamicTextFieldEditor::setUpConnections()
|
||||
{
|
||||
assert(m_connection_list.isEmpty());
|
||||
assert(m_change_connections.isEmpty());
|
||||
//Setup the connection
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::colorChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::colorChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::fontChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::fontChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::taggChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::taggChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textFromChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::textFromChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::textChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::infoNameChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::infoNameChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::rotationChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::rotationChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::frameChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::frameChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::textWidthChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::textWidthChanged,
|
||||
[this](){this -> updateForm();});
|
||||
m_connection_list << connect(m_text_field.data(), &PartDynamicTextField::compositeTextChanged,
|
||||
m_change_connections << connect(m_text_field.data(), &PartDynamicTextField::compositeTextChanged,
|
||||
[this](){this -> updateForm();});
|
||||
}
|
||||
|
||||
void DynamicTextFieldEditor::disconnectConnections()
|
||||
{
|
||||
//Remove previous connection
|
||||
if(!m_connection_list.isEmpty())
|
||||
for(const QMetaObject::Connection& con : m_connection_list) {
|
||||
if(!m_change_connections.isEmpty())
|
||||
for(const QMetaObject::Connection& con : m_change_connections) {
|
||||
disconnect(con);
|
||||
}
|
||||
m_connection_list.clear();
|
||||
m_change_connections.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,7 @@ class DynamicTextFieldEditor : public ElementItemEditor {
|
||||
bool setParts(QList <CustomElementPart *>) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart*> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
|
||||
private:
|
||||
void setupWidget();
|
||||
@@ -73,7 +73,6 @@ class DynamicTextFieldEditor : public ElementItemEditor {
|
||||
Ui::DynamicTextFieldEditor *ui;
|
||||
QPointer<PartDynamicTextField> m_text_field;
|
||||
QList<PartDynamicTextField*> m_parts;
|
||||
QList<QMetaObject::Connection> m_connection_list;
|
||||
|
||||
#ifdef BUILD_WITHOUT_KF5
|
||||
#else
|
||||
|
||||
@@ -110,9 +110,9 @@ QList<CustomElementPart *> EllipseEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief EllipseEditor::updateForm
|
||||
* @brief EllipseEditor::updateFormPriv
|
||||
*/
|
||||
void EllipseEditor::updateForm()
|
||||
void EllipseEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
||||
@@ -43,7 +43,7 @@ class EllipseEditor : public ElementItemEditor
|
||||
bool setParts(QList<CustomElementPart *> parts) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart*> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
|
||||
private slots:
|
||||
void on_m_x_sb_editingFinished();
|
||||
@@ -59,8 +59,7 @@ class EllipseEditor : public ElementItemEditor
|
||||
private:
|
||||
Ui::EllipseEditor *ui;
|
||||
PartEllipse *m_part = nullptr;
|
||||
StyleEditor *m_style = nullptr;
|
||||
QList <QMetaObject::Connection> m_change_connections;
|
||||
StyleEditor *m_style = nullptr;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -176,10 +176,10 @@ QList<CustomElementPart *> LineEditor::currentParts() const {
|
||||
}
|
||||
|
||||
/**
|
||||
@brief LineEditor::updateForm
|
||||
@brief LineEditor::updateFormPriv
|
||||
Reimplemented from ElementItemEditor
|
||||
*/
|
||||
void LineEditor::updateForm()
|
||||
void LineEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
||||
@@ -43,7 +43,7 @@ class LineEditor : public ElementItemEditor
|
||||
bool setParts(QList <CustomElementPart *> parts) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart *> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
|
||||
private:
|
||||
void setUpChangeConnections();
|
||||
@@ -59,8 +59,7 @@ class LineEditor : public ElementItemEditor
|
||||
private:
|
||||
PartLine *m_part = nullptr;
|
||||
Ui::LineEditor *ui;
|
||||
StyleEditor *m_style = nullptr;
|
||||
QList <QMetaObject::Connection> m_change_connections;
|
||||
StyleEditor *m_style = nullptr;
|
||||
bool m_locked = false;
|
||||
};
|
||||
|
||||
|
||||
@@ -130,10 +130,10 @@ QList<CustomElementPart*> PolygonEditor::currentParts() const
|
||||
}
|
||||
|
||||
/**
|
||||
@brief PolygonEditor::updateForm
|
||||
@brief PolygonEditor::updateFormPriv
|
||||
Update the widget
|
||||
*/
|
||||
void PolygonEditor::updateForm()
|
||||
void PolygonEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
||||
@@ -39,7 +39,7 @@ class PolygonEditor : public ElementItemEditor
|
||||
bool setPart(CustomElementPart *part) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart*> currentParts() const override;
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
QVector<QPointF> pointsFromTree();
|
||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
||||
|
||||
@@ -63,7 +63,6 @@ class PolygonEditor : public ElementItemEditor
|
||||
Ui::PolygonEditor *ui;
|
||||
StyleEditor *m_style = nullptr;
|
||||
PartPolygon *m_part = nullptr;
|
||||
QList <QMetaObject::Connection> m_change_connections;
|
||||
};
|
||||
|
||||
#endif // POLYGONEDITOR_H
|
||||
|
||||
@@ -136,7 +136,7 @@ QPointF RectangleEditor::editedTopLeft() const
|
||||
/**
|
||||
@brief RectangleEditor::updateForm
|
||||
*/
|
||||
void RectangleEditor::updateForm()
|
||||
void RectangleEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
||||
@@ -48,7 +48,7 @@ class RectangleEditor : public ElementItemEditor
|
||||
QPointF editedTopLeft () const;
|
||||
|
||||
public slots:
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
private:
|
||||
void editingFinished();
|
||||
void activeConnections(bool active);
|
||||
@@ -70,7 +70,6 @@ class RectangleEditor : public ElementItemEditor
|
||||
StyleEditor *m_style;
|
||||
PartRectangle *m_part;
|
||||
Ui::RectangleEditor *ui;
|
||||
QList <QMetaObject::Connection> m_change_connections;
|
||||
};
|
||||
|
||||
#endif // RECTANGLEEDITOR_H
|
||||
|
||||
@@ -46,11 +46,11 @@ TerminalEditor::~TerminalEditor()
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalEditor::updateForm
|
||||
* @brief TerminalEditor::updateFormPriv
|
||||
* Reimplemented from ElementItemEditor
|
||||
* Update the content of this widget
|
||||
*/
|
||||
void TerminalEditor::updateForm()
|
||||
void TerminalEditor::updateFormPriv()
|
||||
{
|
||||
if (!m_part) {
|
||||
return;
|
||||
|
||||
@@ -39,7 +39,7 @@ class TerminalEditor : public ElementItemEditor
|
||||
TerminalEditor(QETElementEditor *editor, QWidget *parent = nullptr);
|
||||
~TerminalEditor() override;
|
||||
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
bool setPart(CustomElementPart *new_part) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
QList<CustomElementPart *> currentParts() const override {return QList<CustomElementPart *>();}
|
||||
@@ -55,8 +55,7 @@ class TerminalEditor : public ElementItemEditor
|
||||
|
||||
private:
|
||||
Ui::TerminalEditor *ui;
|
||||
QVector<QMetaObject::Connection> m_editor_connections,
|
||||
m_change_connections;
|
||||
QVector<QMetaObject::Connection> m_editor_connections;
|
||||
PartTerminal *m_part = nullptr;
|
||||
bool m_locked = false;
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ TextEditor::~TextEditor() {}
|
||||
@brief TextEditor::updateForm
|
||||
Update the gui
|
||||
*/
|
||||
void TextEditor::updateForm()
|
||||
void TextEditor::updateFormPriv()
|
||||
{
|
||||
if (m_text.isNull()) {
|
||||
return;
|
||||
|
||||
@@ -38,7 +38,7 @@ class TextEditor : public ElementItemEditor {
|
||||
explicit TextEditor(QETElementEditor *editor, PartText *text = nullptr, QWidget *parent = nullptr);
|
||||
~TextEditor() override;
|
||||
|
||||
void updateForm() override;
|
||||
void updateFormPriv() override;
|
||||
bool setPart(CustomElementPart *part) override;
|
||||
bool setParts(QList <CustomElementPart *>) override;
|
||||
CustomElementPart *currentPart() const override;
|
||||
|
||||
Reference in New Issue
Block a user