diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-13 12:41:29 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-05-13 22:34:16 +0200 |
commit | 2a05e4cc6eba5a74e12563e77afa18d4548c9a3b (patch) | |
tree | e998bb037254bd2bf44721f0104351c6f35bd619 /src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp | |
parent | 495b7e2a18433a152601d1438790957c77d2ae6e (diff) | |
download | qttools-2a05e4cc6eba5a74e12563e77afa18d4548c9a3b.tar.gz |
Qt Designer/Active Qt plugin: Polish the code a bit
Use auto, raw string literals, member initialization and
streamline a bit.
Pick-to: 5.15
Change-Id: I08c49c40e3636fe711568c10a8f4cae226700a87
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp')
-rw-r--r-- | src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp index 960316cf2..e1236b274 100644 --- a/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp +++ b/src/designer/src/plugins/activeqt/qaxwidgetpropertysheet.cpp @@ -130,7 +130,7 @@ int QAxWidgetPropertySheet::indexOf(const QString &name) const return index; // Loading before recreation of sheet in timer slot: Add a fake property to store the value const QVariant dummValue(0); - QAxWidgetPropertySheet *that = const_cast<QAxWidgetPropertySheet *>(this); + auto that = const_cast<QAxWidgetPropertySheet *>(this); const int newIndex = that->createFakeProperty(name, dummValue); that->setPropertyGroup(newIndex, m_propertyGroup); return newIndex; @@ -142,7 +142,7 @@ void QAxWidgetPropertySheet::updatePropertySheet() struct SavedProperties tmp = m_currentProperties; QDesignerAxWidget *axw = axWidget(); QDesignerFormWindowInterface *formWin = QDesignerFormWindowInterface::findFormWindow(axw); - Q_ASSERT(formWin != 0); + Q_ASSERT(formWin != nullptr); tmp.widget = axw; tmp.clsid = axw->control(); // Delete the sheets as they cache the meta object and other information @@ -151,16 +151,18 @@ void QAxWidgetPropertySheet::updatePropertySheet() reloadPropertySheet(tmp, formWin); } -void QAxWidgetPropertySheet::reloadPropertySheet(const struct SavedProperties &properties, QDesignerFormWindowInterface *formWin) +void QAxWidgetPropertySheet::reloadPropertySheet(const struct SavedProperties &properties, + QDesignerFormWindowInterface *formWin) { QDesignerFormEditorInterface *core = formWin->core(); //Recreation of the property sheet - QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension *>(core->extensionManager(), properties.widget); + auto sheet = qt_extension<QDesignerPropertySheetExtension *>(core->extensionManager(), + properties.widget); bool foundGeometry = false; const QString geometryProperty = QLatin1String(geometryPropertyC); - const SavedProperties::NamePropertyMap::const_iterator cend = properties.changedProperties.constEnd(); - for (SavedProperties::NamePropertyMap::const_iterator i = properties.changedProperties.constBegin(); i != cend; ++i) { + for (auto i = properties.changedProperties.cbegin(), cend = properties.changedProperties.cend(); + i != cend; ++i) { const QString name = i.key(); const int index = sheet->indexOf(name); if (index == -1) |