diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-03-25 13:27:59 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-04-06 09:59:19 +0000 |
commit | c8d1584638e3fcdb1a2926b6f7f97690cea1c0e8 (patch) | |
tree | 344ec3570e93d489987bffd0f057d494a3b11deb | |
parent | e06e2b240b885af7907cbe01e2c0cd539e094094 (diff) | |
download | qttools-c8d1584638e3fcdb1a2926b6f7f97690cea1c0e8.tar.gz |
Qt Designer: Add checks to setters of QDesignerWidgetBoxInterface::Widget
4f3b1a4ec8bb9c3a086469f397c9cafee36b5b8f changed the class
to use QSharedDataPointer, but forgot to add the setter checks
to prevent it from detaching.
Task-number: QTBUG-102028
Change-Id: I36d01518dd5fc1739349e7b3f2697c753b5a31ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 9e18f5b88702778f75b40c6c8038eb79c9e9a653)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_widgetbox.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp index 03cd9a3ad..26158bf0f 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp @@ -86,7 +86,8 @@ QString QDesignerWidgetBoxInterface::Widget::name() const void QDesignerWidgetBoxInterface::Widget::setName(const QString &aname) { - m_data->m_name = aname; + if (m_data->m_name != aname) + m_data->m_name = aname; } QString QDesignerWidgetBoxInterface::Widget::domXml() const @@ -96,7 +97,8 @@ QString QDesignerWidgetBoxInterface::Widget::domXml() const void QDesignerWidgetBoxInterface::Widget::setDomXml(const QString &xml) { - m_data->m_xml = xml; + if (m_data->m_xml != xml) + m_data->m_xml = xml; } QString QDesignerWidgetBoxInterface::Widget::iconName() const @@ -106,7 +108,8 @@ QString QDesignerWidgetBoxInterface::Widget::iconName() const void QDesignerWidgetBoxInterface::Widget::setIconName(const QString &icon_name) { - m_data->m_icon_name = icon_name; + if (m_data->m_icon_name != icon_name) + m_data->m_icon_name = icon_name; } QDesignerWidgetBoxInterface::Widget::Type QDesignerWidgetBoxInterface::Widget::type() const @@ -116,7 +119,8 @@ QDesignerWidgetBoxInterface::Widget::Type QDesignerWidgetBoxInterface::Widget::t void QDesignerWidgetBoxInterface::Widget::setType(Type atype) { - m_data->m_type = atype; + if (m_data->m_type != atype) + m_data->m_type = atype; } bool QDesignerWidgetBoxInterface::Widget::isNull() const |