diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-06 16:04:19 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-02-07 08:21:51 +0100 |
commit | bf8cf6f054d696a82bb4728cb4bcd9259674aa95 (patch) | |
tree | e1874394add361005214f5388afe534299cffb99 /src/designer | |
parent | 59985078bb87047cf30112292f97f4749d754941 (diff) |
Qt Designer: Refactor class PropertySheetIconValue
Use the default for copy/assignment. Add missing move constructor/move
assignment and fix up the debug operator.
Task-number: QTBUG-121823
Pick-to: 6.7
Change-Id: Ic273a4da69eac155de8c018d8e67183cdf503fac
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Diffstat (limited to 'src/designer')
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_utils.cpp | 35 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_utils_p.h | 6 |
2 files changed, 21 insertions, 20 deletions
diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp index 7d02f73c1..d4b42ffb7 100644 --- a/src/designer/src/lib/shared/qdesigner_utils.cpp +++ b/src/designer/src/lib/shared/qdesigner_utils.cpp @@ -307,17 +307,11 @@ namespace qdesigner_internal PropertySheetIconValue::~PropertySheetIconValue() = default; - PropertySheetIconValue::PropertySheetIconValue(const PropertySheetIconValue &rhs) : - m_data(rhs.m_data) - { - } + PropertySheetIconValue::PropertySheetIconValue(const PropertySheetIconValue &rhs) noexcept = default; + PropertySheetIconValue &PropertySheetIconValue::operator=(const PropertySheetIconValue &rhs) = default; - PropertySheetIconValue &PropertySheetIconValue::operator=(const PropertySheetIconValue &rhs) - { - if (this != &rhs) - m_data.operator=(rhs.m_data); - return *this; - } + PropertySheetIconValue::PropertySheetIconValue(PropertySheetIconValue &&) noexcept = default; + PropertySheetIconValue &PropertySheetIconValue::operator=(PropertySheetIconValue &&) noexcept = default; } // namespace qdesigner_internal @@ -621,17 +615,22 @@ namespace qdesigner_internal { return m_data->m_paths; } - QDESIGNER_SHARED_EXPORT QDebug operator<<(QDebug d, const PropertySheetIconValue &p) + QDESIGNER_SHARED_EXPORT QDebug operator<<(QDebug debug, const PropertySheetIconValue &p) { - QDebug nospace = d.nospace(); - nospace << "PropertySheetIconValue theme='" << p.theme() << "' "; + QDebugStateSaver saver(debug); + debug.nospace(); + debug.noquote(); + debug << "PropertySheetIconValue(mask=0x" << Qt::hex << p.mask() << Qt::dec << ", "; + if (!p.theme().isEmpty()) + debug << "XDG theme=\"" << p.theme() << "\", "; const PropertySheetIconValue::ModeStateToPixmapMap &paths = p.paths(); - for (auto it = paths.constBegin(), cend = paths.constEnd(); it != cend; ++it) - nospace << " mode=" << it.key().first << ",state=" << it.key().second - << ",'" << it.value().path() << '\''; - nospace << " mask=0x" << QString::number(p.mask(), 16); - return d; + for (auto it = paths.constBegin(), cend = paths.constEnd(); it != cend; ++it) { + debug << " mode=" << it.key().first << ",state=" << it.key().second + << ", \"" << it.value().path() << '"'; + } + debug << ')'; + return debug; } QDESIGNER_SHARED_EXPORT QDesignerFormWindowCommand *createTextPropertyCommand(const QString &propertyName, const QString &text, QObject *object, QDesignerFormWindowInterface *fw) diff --git a/src/designer/src/lib/shared/qdesigner_utils_p.h b/src/designer/src/lib/shared/qdesigner_utils_p.h index 1766705ca..3199d93b9 100644 --- a/src/designer/src/lib/shared/qdesigner_utils_p.h +++ b/src/designer/src/lib/shared/qdesigner_utils_p.h @@ -242,11 +242,13 @@ class PropertySheetIconValueData; class QDESIGNER_SHARED_EXPORT PropertySheetIconValue { public: - PropertySheetIconValue(const PropertySheetPixmapValue &pixmap); + explicit PropertySheetIconValue(const PropertySheetPixmapValue &pixmap); PropertySheetIconValue(); ~PropertySheetIconValue(); - PropertySheetIconValue(const PropertySheetIconValue &); + PropertySheetIconValue(const PropertySheetIconValue &) noexcept; PropertySheetIconValue &operator=(const PropertySheetIconValue &); + PropertySheetIconValue(PropertySheetIconValue &&) noexcept; + PropertySheetIconValue &operator=(PropertySheetIconValue &&) noexcept; bool isEmpty() const; |