diff --git a/sources/editor/arceditor.h b/sources/editor/arceditor.h index b37a71dc0..36781733f 100644 --- a/sources/editor/arceditor.h +++ b/sources/editor/arceditor.h @@ -46,8 +46,6 @@ class ArcEditor : public ElementItemEditor QDoubleSpinBox *x, *y, *h, *v; QSpinBox *angle, *start_angle; bool m_locked; - - QList m_change_connections; // methods public: diff --git a/sources/editor/elementitemeditor.h b/sources/editor/elementitemeditor.h index 9ddda01ec..ebd5637c4 100644 --- a/sources/editor/elementitemeditor.h +++ b/sources/editor/elementitemeditor.h @@ -63,6 +63,8 @@ class ElementItemEditor : public QWidget private: virtual void updateFormPriv() = 0; +protected: + QList m_change_connections; // attributes private: QETElementEditor *element_editor; diff --git a/sources/editor/ui/dynamictextfieldeditor.cpp b/sources/editor/ui/dynamictextfieldeditor.cpp index 5624514b6..6c2876d06 100644 --- a/sources/editor/ui/dynamictextfieldeditor.cpp +++ b/sources/editor/ui/dynamictextfieldeditor.cpp @@ -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); } } @@ -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(); } /** diff --git a/sources/editor/ui/dynamictextfieldeditor.h b/sources/editor/ui/dynamictextfieldeditor.h index 1c83d20b4..3c4718263 100644 --- a/sources/editor/ui/dynamictextfieldeditor.h +++ b/sources/editor/ui/dynamictextfieldeditor.h @@ -73,7 +73,6 @@ class DynamicTextFieldEditor : public ElementItemEditor { Ui::DynamicTextFieldEditor *ui; QPointer m_text_field; QList m_parts; - QList m_connection_list; #ifdef BUILD_WITHOUT_KF5 #else diff --git a/sources/editor/ui/ellipseeditor.h b/sources/editor/ui/ellipseeditor.h index b702a3439..df1a8d56e 100644 --- a/sources/editor/ui/ellipseeditor.h +++ b/sources/editor/ui/ellipseeditor.h @@ -59,8 +59,7 @@ class EllipseEditor : public ElementItemEditor private: Ui::EllipseEditor *ui; PartEllipse *m_part = nullptr; - StyleEditor *m_style = nullptr; - QList m_change_connections; + StyleEditor *m_style = nullptr; }; diff --git a/sources/editor/ui/lineeditor.h b/sources/editor/ui/lineeditor.h index 20b7ec91e..0807dc150 100644 --- a/sources/editor/ui/lineeditor.h +++ b/sources/editor/ui/lineeditor.h @@ -59,8 +59,7 @@ class LineEditor : public ElementItemEditor private: PartLine *m_part = nullptr; Ui::LineEditor *ui; - StyleEditor *m_style = nullptr; - QList m_change_connections; + StyleEditor *m_style = nullptr; bool m_locked = false; }; diff --git a/sources/editor/ui/polygoneditor.h b/sources/editor/ui/polygoneditor.h index ec60d0360..3712c4c00 100644 --- a/sources/editor/ui/polygoneditor.h +++ b/sources/editor/ui/polygoneditor.h @@ -63,7 +63,6 @@ class PolygonEditor : public ElementItemEditor Ui::PolygonEditor *ui; StyleEditor *m_style = nullptr; PartPolygon *m_part = nullptr; - QList m_change_connections; }; #endif // POLYGONEDITOR_H diff --git a/sources/editor/ui/rectangleeditor.h b/sources/editor/ui/rectangleeditor.h index 3d9df6f57..01a375341 100644 --- a/sources/editor/ui/rectangleeditor.h +++ b/sources/editor/ui/rectangleeditor.h @@ -70,7 +70,6 @@ class RectangleEditor : public ElementItemEditor StyleEditor *m_style; PartRectangle *m_part; Ui::RectangleEditor *ui; - QList m_change_connections; }; #endif // RECTANGLEEDITOR_H diff --git a/sources/editor/ui/terminaleditor.h b/sources/editor/ui/terminaleditor.h index 89a44c0f4..33baae9c7 100644 --- a/sources/editor/ui/terminaleditor.h +++ b/sources/editor/ui/terminaleditor.h @@ -55,8 +55,7 @@ class TerminalEditor : public ElementItemEditor private: Ui::TerminalEditor *ui; - QVector m_editor_connections, - m_change_connections; + QVector m_editor_connections; PartTerminal *m_part = nullptr; bool m_locked = false; };