diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-03-25 13:27:59 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-04-06 09:00:48 +0100 |
commit | 9e18f5b88702778f75b40c6c8038eb79c9e9a653 (patch) | |
tree | 5b8a279540c8ae6d1a383fd0459dd59f1efbe5fb /src/designer/src/lib/shared | |
parent | 397309dfb0aeaaf3c051f6800d92d3baaa8c935d (diff) | |
download | qttools-9e18f5b88702778f75b40c6c8038eb79c9e9a653.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.
Pick-to: 6.3 6.2
Task-number: QTBUG-102028
Change-Id: I36d01518dd5fc1739349e7b3f2697c753b5a31ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer/src/lib/shared')
-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 |