mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
move m_change_connections to ElementItemEditor, so it must not be defined by every editor it self
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);
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user