diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-04 08:49:58 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-06-11 09:23:57 +0200 |
commit | fac0dcbeef6a0c23e780b9751c17883ec9918d6f (patch) | |
tree | 82ba10f4f93ebb02968c0e65a90f3daeea552b83 | |
parent | dbbe4be100e757ff17ca6b8533946c7b55880f8d (diff) | |
download | qttools-fac0dcbeef6a0c23e780b9751c17883ec9918d6f.tar.gz |
Qt Designer: introduce member initialization
Fix warnings emitted by clang, use default constructors where
applicable.
Initialize remaining member variables about which clang warns
about missing initialization in the constructor.
Change-Id: Ic23a1f36f7507dc728ca6daf0d2067727125c0a9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
71 files changed, 238 insertions, 427 deletions
diff --git a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp index 3c1479ba8..201c30f50 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor_plugin.cpp @@ -39,10 +39,7 @@ QT_BEGIN_NAMESPACE using namespace qdesigner_internal; -BuddyEditorPlugin::BuddyEditorPlugin() - : m_initialized(false) -{ -} +BuddyEditorPlugin::BuddyEditorPlugin() = default; BuddyEditorPlugin::~BuddyEditorPlugin() = default; diff --git a/src/designer/src/components/buddyeditor/buddyeditor_plugin.h b/src/designer/src/components/buddyeditor/buddyeditor_plugin.h index 316d5f0d7..340c239b0 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor_plugin.h +++ b/src/designer/src/components/buddyeditor/buddyeditor_plugin.h @@ -70,8 +70,8 @@ private slots: private: QPointer<QDesignerFormEditorInterface> m_core; QHash<QDesignerFormWindowInterface*, BuddyEditorTool*> m_tools; - bool m_initialized; - QAction *m_action; + bool m_initialized = false; + QAction *m_action = nullptr; }; } // namespace qdesigner_internal diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.cpp b/src/designer/src/components/formeditor/embeddedoptionspage.cpp index e17b2b6df..c09571070 100644 --- a/src/designer/src/components/formeditor/embeddedoptionspage.cpp +++ b/src/designer/src/components/formeditor/embeddedoptionspage.cpp @@ -109,9 +109,9 @@ private: QLabel *m_descriptionLabel; DeviceProfileList m_sortedProfiles; - EmbeddedOptionsControl *m_q; - bool m_dirty; + EmbeddedOptionsControl *m_q = nullptr; QSet<QString> m_usedProfiles; + bool m_dirty = false; }; EmbeddedOptionsControlPrivate::EmbeddedOptionsControlPrivate(QDesignerFormEditorInterface *core) : @@ -120,9 +120,7 @@ EmbeddedOptionsControlPrivate::EmbeddedOptionsControlPrivate(QDesignerFormEditor m_addButton(new QToolButton), m_editButton(new QToolButton), m_deleteButton(new QToolButton), - m_descriptionLabel(new QLabel), - m_q(0), - m_dirty(false) + m_descriptionLabel(new QLabel) { m_descriptionLabel->setMinimumHeight(80); // Determine used profiles to lock them diff --git a/src/designer/src/components/formeditor/formwindow.h b/src/designer/src/components/formeditor/formwindow.h index 9edfa5d53..e2fb78400 100644 --- a/src/designer/src/components/formeditor/formwindow.h +++ b/src/designer/src/components/formeditor/formwindow.h @@ -320,10 +320,10 @@ private: FormEditor *m_core; FormWindowCursor *m_cursor; - QWidget *m_mainContainer; - QWidget *m_currentWidget; + QWidget *m_mainContainer = nullptr; + QWidget *m_currentWidget = nullptr; - bool m_blockSelectionChanged; + bool m_blockSelectionChanged = false; QPoint m_rectAnchor; QRect m_currRect; @@ -340,18 +340,18 @@ private: QString m_fileName; - typedef QPair<QPalette ,bool> PaletteAndFill; - typedef QMap<QWidget*, PaletteAndFill> WidgetPaletteMap; + using PaletteAndFill = QPair<QPalette ,bool>; + using WidgetPaletteMap = QMap<QWidget*, PaletteAndFill>; WidgetPaletteMap m_palettesBeforeHighlight; - QRubberBand *m_rubberBand; + QRubberBand *m_rubberBand = nullptr; - QTimer *m_selectionChangedTimer; - QTimer *m_checkSelectionTimer; - QTimer *m_geometryChangedTimer; + QTimer *m_selectionChangedTimer = nullptr; + QTimer *m_checkSelectionTimer = nullptr; + QTimer *m_geometryChangedTimer = nullptr; FormWindowWidgetStack *m_widgetStack; - WidgetEditorTool *m_widgetEditor; + WidgetEditorTool *m_widgetEditor = nullptr; QStringList m_resourceFiles; diff --git a/src/designer/src/components/formeditor/formwindowmanager.h b/src/designer/src/components/formeditor/formwindowmanager.h index 16fa319f4..f2f007186 100644 --- a/src/designer/src/components/formeditor/formwindowmanager.h +++ b/src/designer/src/components/formeditor/formwindowmanager.h @@ -133,38 +133,38 @@ private: // edit actions #if QT_CONFIG(clipboard) - QAction *m_actionCut; - QAction *m_actionCopy; - QAction *m_actionPaste; + QAction *m_actionCut = nullptr; + QAction *m_actionCopy = nullptr; + QAction *m_actionPaste = nullptr; #endif - QAction *m_actionSelectAll; - QAction *m_actionDelete; - QAction *m_actionLower; - QAction *m_actionRaise; + QAction *m_actionSelectAll = nullptr; + QAction *m_actionDelete = nullptr; + QAction *m_actionLower = nullptr; + QAction *m_actionRaise = nullptr; // layout actions - QAction *m_actionHorizontalLayout; - QAction *m_actionVerticalLayout; - QAction *m_actionFormLayout; - QAction *m_actionSplitHorizontal; - QAction *m_actionSplitVertical; - QAction *m_actionGridLayout; - QAction *m_actionBreakLayout; - QAction *m_actionSimplifyLayout; - QAction *m_actionAdjustSize; + QAction *m_actionHorizontalLayout = nullptr; + QAction *m_actionVerticalLayout = nullptr; + QAction *m_actionFormLayout = nullptr; + QAction *m_actionSplitHorizontal = nullptr; + QAction *m_actionSplitVertical = nullptr; + QAction *m_actionGridLayout = nullptr; + QAction *m_actionBreakLayout = nullptr; + QAction *m_actionSimplifyLayout = nullptr; + QAction *m_actionAdjustSize = nullptr; // preview actions - QAction *m_actionDefaultPreview; - mutable PreviewActionGroup *m_actionGroupPreviewInStyle; - QAction *m_actionShowFormWindowSettingsDialog; + QAction *m_actionDefaultPreview = nullptr; + mutable PreviewActionGroup *m_actionGroupPreviewInStyle = nullptr; + QAction *m_actionShowFormWindowSettingsDialog = nullptr; - QAction *m_actionUndo; - QAction *m_actionRedo; + QAction *m_actionUndo = nullptr; + QAction *m_actionRedo = nullptr; QSet<QWidget *> getUnsortedLayoutsToBeBroken(bool firstOnly) const; bool hasLayoutsToBeBroken() const; QWidgetList layoutsToBeBroken(QWidget *w) const; QWidgetList layoutsToBeBroken() const; - QUndoGroup *m_undoGroup; + QUndoGroup *m_undoGroup = nullptr; }; diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp index 46a8ee405..95a5c6729 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp +++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp @@ -134,21 +134,13 @@ namespace qdesigner_internal { // comparing the lists of ObjectData. If it is the same, only the item data (class name [changed by promotion], // object name and icon) are checked and the existing items are updated. - ObjectData::ObjectData() : - m_parent(0), - m_object(0), - m_type(Object), - m_managedLayoutType(LayoutInfo::NoLayout) - { - } + ObjectData::ObjectData() = default; ObjectData::ObjectData(QObject *parent, QObject *object, const ModelRecursionContext &ctx) : m_parent(parent), m_object(object), - m_type(Object), m_className(QLatin1String(object->metaObject()->className())), - m_objectName(object->objectName()), - m_managedLayoutType(LayoutInfo::NoLayout) + m_objectName(object->objectName()) { // 1) set entry diff --git a/src/designer/src/components/objectinspector/objectinspectormodel_p.h b/src/designer/src/components/objectinspector/objectinspectormodel_p.h index 67d2bfd07..5a4593e6c 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel_p.h +++ b/src/designer/src/components/objectinspector/objectinspectormodel_p.h @@ -102,13 +102,13 @@ namespace qdesigner_internal { void initObject(const ModelRecursionContext &ctx); void initWidget(QWidget *w, const ModelRecursionContext &ctx); - QObject *m_parent; - QObject *m_object; - Type m_type; + QObject *m_parent = nullptr; + QObject *m_object = nullptr; + Type m_type = Object; QString m_className; QString m_objectName; QIcon m_classIcon; - LayoutInfo::Type m_managedLayoutType; + LayoutInfo::Type m_managedLayoutType = LayoutInfo::NoLayout; }; inline bool operator==(const ObjectData &e1, const ObjectData &e2) { return e1.equals(e2); } diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp index a57c5c4d2..68e95f325 100644 --- a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp @@ -51,8 +51,7 @@ namespace qdesigner_internal { QT_TRANSLATE_NOOP("FontPropertyManager", "PreferAntialias") }; - FontPropertyManager::FontPropertyManager() : - m_createdFontProperty(0) + FontPropertyManager::FontPropertyManager() { const int nameCount = sizeof(aliasingC)/sizeof(const char *); for (int i = 0; i < nameCount; i++) diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.h b/src/designer/src/components/propertyeditor/fontpropertymanager.h index 0d191ac77..b42667737 100644 --- a/src/designer/src/components/propertyeditor/fontpropertymanager.h +++ b/src/designer/src/components/propertyeditor/fontpropertymanager.h @@ -96,7 +96,7 @@ private: PropertyToSubPropertiesMap m_propertyToFontSubProperties; QMap<QtProperty *, int> m_fontSubPropertyToFlag; PropertyToPropertyMap m_fontSubPropertyToProperty; - QtProperty *m_createdFontProperty; + QtProperty *m_createdFontProperty = nullptr; QStringList m_aliasingEnumNames; // Font families with Designer annotations QStringList m_designerFamilyNames; diff --git a/src/designer/src/components/propertyeditor/paletteeditor.cpp b/src/designer/src/components/propertyeditor/paletteeditor.cpp index 6cfb5e41c..0945ffa6c 100644 --- a/src/designer/src/components/propertyeditor/paletteeditor.cpp +++ b/src/designer/src/components/propertyeditor/paletteeditor.cpp @@ -224,8 +224,7 @@ QPalette PaletteEditor::getPalette(QDesignerFormEditorInterface *core, QWidget* ////////////////////// PaletteModel::PaletteModel(QObject *parent) : - QAbstractTableModel(parent), - m_compute(true) + QAbstractTableModel(parent) { const QMetaObject *meta = metaObject(); const int index = meta->indexOfProperty("colorRole"); @@ -403,7 +402,6 @@ int PaletteModel::groupToColumn(QPalette::ColorGroup group) const BrushEditor::BrushEditor(QDesignerFormEditorInterface *core, QWidget *parent) : QWidget(parent), m_button(new QtColorButton(this)), - m_changed(false), m_core(core) { QLayout *layout = new QHBoxLayout(this); @@ -439,8 +437,7 @@ bool BrushEditor::changed() const RoleEditor::RoleEditor(QWidget *parent) : QWidget(parent), - m_label(new QLabel(this)), - m_edited(false) + m_label(new QLabel(this)) { QHBoxLayout *layout = new QHBoxLayout(this); layout->setContentsMargins(QMargins()); diff --git a/src/designer/src/components/propertyeditor/paletteeditor.h b/src/designer/src/components/propertyeditor/paletteeditor.h index 77785bc69..5f3d28ee8 100644 --- a/src/designer/src/components/propertyeditor/paletteeditor.h +++ b/src/designer/src/components/propertyeditor/paletteeditor.h @@ -120,7 +120,7 @@ private: QPalette m_palette; QPalette m_parentPalette; QMap<QPalette::ColorRole, QString> m_roleNames; - bool m_compute; + bool m_compute = true; }; class BrushEditor : public QWidget @@ -138,7 +138,7 @@ private slots: void brushChanged(); private: QtColorButton *m_button; - bool m_changed; + bool m_changed = false; QDesignerFormEditorInterface *m_core; }; @@ -157,7 +157,7 @@ private slots: void emitResetProperty(); private: QLabel *m_label; - bool m_edited; + bool m_edited = false; }; class ColorDelegate : public QItemDelegate diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp index 486e7c202..29401e93b 100644 --- a/src/designer/src/components/propertyeditor/propertyeditor.cpp +++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp @@ -202,26 +202,16 @@ static inline QToolButton *createDropDownButton(QAction *defaultAction, QWidget PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *parent, Qt::WindowFlags flags) : QDesignerPropertyEditor(parent, flags), m_core(core), - m_propertySheet(0), - m_currentBrowser(0), - m_treeBrowser(0), m_propertyManager(new DesignerPropertyManager(m_core, this)), - m_dynamicGroup(0), - m_updatingBrowser(false), m_stackedWidget(new QStackedWidget), m_filterWidget(new QLineEdit), - m_buttonIndex(-1), - m_treeIndex(-1), m_addDynamicAction(new QAction(createIconSet(QStringLiteral("plus.png")), tr("Add Dynamic Property..."), this)), m_removeDynamicAction(new QAction(createIconSet(QStringLiteral("minus.png")), tr("Remove Dynamic Property"), this)), m_sortingAction(new QAction(createIconSet(QStringLiteral("sort.png")), tr("Sorting"), this)), m_coloringAction(new QAction(createIconSet(QStringLiteral("color.png")), tr("Color Groups"), this)), m_treeAction(new QAction(tr("Tree View"), this)), m_buttonAction(new QAction(tr("Drop Down Button View"), this)), - m_classLabel(new ElidingLabel), - m_sorting(false), - m_coloring(false), - m_brightness(false) + m_classLabel(new ElidingLabel) { QVector<QColor> colors; colors.reserve(6); diff --git a/src/designer/src/components/propertyeditor/propertyeditor.h b/src/designer/src/components/propertyeditor/propertyeditor.h index 819e65108..cc32b2fde 100644 --- a/src/designer/src/components/propertyeditor/propertyeditor.h +++ b/src/designer/src/components/propertyeditor/propertyeditor.h @@ -146,10 +146,10 @@ private: const Strings m_strings; QDesignerFormEditorInterface *m_core; - QDesignerPropertySheetExtension *m_propertySheet; - QtAbstractPropertyBrowser *m_currentBrowser; + QDesignerPropertySheetExtension *m_propertySheet = nullptr; + QtAbstractPropertyBrowser *m_currentBrowser = nullptr; QtButtonPropertyBrowser *m_buttonBrowser; - QtTreePropertyBrowser *m_treeBrowser; + QtTreePropertyBrowser *m_treeBrowser = nullptr; DesignerPropertyManager *m_propertyManager; DesignerEditorFactory *m_treeFactory; DesignerEditorFactory *m_groupFactory; @@ -158,14 +158,14 @@ private: QMap<QtProperty*, QString> m_propertyToGroup; QMap<QString, QtVariantProperty*> m_nameToGroup; QList<QtProperty *> m_groups; - QtProperty *m_dynamicGroup; + QtProperty *m_dynamicGroup = nullptr; QString m_recentlyAddedDynamicProperty; - bool m_updatingBrowser; + bool m_updatingBrowser = false; QStackedWidget *m_stackedWidget; QLineEdit *m_filterWidget; - int m_buttonIndex; - int m_treeIndex; + int m_buttonIndex = -1; + int m_treeIndex = -1; QAction *m_addDynamicAction; QAction *m_removeDynamicAction; QAction *m_sortingAction; @@ -174,8 +174,8 @@ private: QAction *m_buttonAction; ElidingLabel *m_classLabel; - bool m_sorting; - bool m_coloring; + bool m_sorting = false; + bool m_coloring = false; QMap<QString, bool> m_expansionState; @@ -184,7 +184,7 @@ private: QPair<QColor, QColor> m_dynamicColor; QPair<QColor, QColor> m_layoutColor; - bool m_brightness; + bool m_brightness = false; }; } // namespace qdesigner_internal diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp index eb78db640..a3e9a5de5 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.cpp @@ -38,10 +38,7 @@ QT_BEGIN_NAMESPACE using namespace qdesigner_internal; -SignalSlotEditorPlugin::SignalSlotEditorPlugin() - : m_initialized(false), m_action(0) -{ -} +SignalSlotEditorPlugin::SignalSlotEditorPlugin() = default; SignalSlotEditorPlugin::~SignalSlotEditorPlugin() = default; diff --git a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.h b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.h index 4b27b5102..fc4cabdcd 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.h +++ b/src/designer/src/components/signalsloteditor/signalsloteditor_plugin.h @@ -69,8 +69,8 @@ private slots: private: QPointer<QDesignerFormEditorInterface> m_core; QHash<QDesignerFormWindowInterface*, SignalSlotEditorTool*> m_tools; - bool m_initialized; - QAction *m_action; + bool m_initialized = false; + QAction *m_action = nullptr; }; } // namespace qdesigner_internal diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index 2b7ba45b8..1bcf3bf8f 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -510,12 +510,11 @@ private slots: private: InlineEditorModel *m_model; - int m_idx; + int m_idx = -1; }; InlineEditor::InlineEditor(QWidget *parent) : - QComboBox(parent), - m_idx(-1) + QComboBox(parent) { setModel(m_model = new InlineEditorModel(0, 4, this)); setFrame(false); diff --git a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp index 813109232..8e54a484d 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp +++ b/src/designer/src/components/tabordereditor/tabordereditor_plugin.cpp @@ -39,14 +39,9 @@ QT_BEGIN_NAMESPACE using namespace qdesigner_internal; -TabOrderEditorPlugin::TabOrderEditorPlugin() - : m_initialized(false) -{ -} +TabOrderEditorPlugin::TabOrderEditorPlugin() = default; -TabOrderEditorPlugin::~TabOrderEditorPlugin() -{ -} +TabOrderEditorPlugin::~TabOrderEditorPlugin() = default; bool TabOrderEditorPlugin::isInitialized() const { diff --git a/src/designer/src/components/tabordereditor/tabordereditor_plugin.h b/src/designer/src/components/tabordereditor/tabordereditor_plugin.h index 9322a4480..cf7b28d56 100644 --- a/src/designer/src/components/tabordereditor/tabordereditor_plugin.h +++ b/src/designer/src/components/tabordereditor/tabordereditor_plugin.h @@ -70,8 +70,8 @@ private slots: private: QPointer<QDesignerFormEditorInterface> m_core; QHash<QDesignerFormWindowInterface*, TabOrderEditorTool*> m_tools; - bool m_initialized; - QAction *m_action; + bool m_initialized = false; + QAction *m_action = nullptr; }; } // namespace qdesigner_internal diff --git a/src/designer/src/components/taskmenu/button_taskmenu.cpp b/src/designer/src/components/taskmenu/button_taskmenu.cpp index 899c1c474..01dca2a63 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/button_taskmenu.cpp @@ -303,10 +303,7 @@ bool RemoveButtonsFromGroupCommand::init(const ButtonList &bl) ButtonGroupMenu::ButtonGroupMenu(QObject *parent) : QObject(parent), m_selectGroupAction(new QAction(tr("Select members"), this)), - m_breakGroupAction(new QAction(tr("Break"), this)), - m_formWindow(0), - m_buttonGroup(0), - m_currentButton(0) + m_breakGroupAction(new QAction(tr("Break"), this)) { connect(m_breakGroupAction, &QAction::triggered, this, &ButtonGroupMenu::breakGroup); connect(m_selectGroupAction, &QAction::triggered, this, &ButtonGroupMenu::selectGroup); diff --git a/src/designer/src/components/taskmenu/button_taskmenu.h b/src/designer/src/components/taskmenu/button_taskmenu.h index f15e6b0e3..dcdecfade 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.h +++ b/src/designer/src/components/taskmenu/button_taskmenu.h @@ -69,9 +69,9 @@ private: QAction *m_selectGroupAction; QAction *m_breakGroupAction; - QDesignerFormWindowInterface *m_formWindow; - QButtonGroup *m_buttonGroup; - QAbstractButton *m_currentButton; + QDesignerFormWindowInterface *m_formWindow = nullptr; + QButtonGroup *m_buttonGroup = nullptr; + QAbstractButton *m_currentButton = nullptr; }; // Task menu extension of a QButtonGroup diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.h b/src/designer/src/components/taskmenu/containerwidget_taskmenu.h index 7074137d1..907e6e66d 100644 --- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.h @@ -118,10 +118,10 @@ public: private: void initializeActions(); - QAction *m_nextAction; - QAction *m_previousAction; - QAction *m_tileAction; - QAction *m_cascadeAction; + QAction *m_nextAction = nullptr; + QAction *m_previousAction = nullptr; + QAction *m_tileAction = nullptr; + QAction *m_cascadeAction = nullptr; }; class ContainerWidgetTaskMenuFactory: public QExtensionFactory diff --git a/src/designer/src/components/taskmenu/itemlisteditor.cpp b/src/designer/src/components/taskmenu/itemlisteditor.cpp index a5ec15e48..c8aaf9e29 100644 --- a/src/designer/src/components/taskmenu/itemlisteditor.cpp +++ b/src/designer/src/components/taskmenu/itemlisteditor.cpp @@ -68,8 +68,7 @@ private: ////////////////// Item editor /////////////// AbstractItemEditor::AbstractItemEditor(QDesignerFormWindowInterface *form, QWidget *parent) : QWidget(parent), - m_iconCache(qobject_cast<FormWindowBase *>(form)->iconCache()), - m_updatingBrowser(false) + m_iconCache(qobject_cast<FormWindowBase *>(form)->iconCache()) { setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); m_propertyManager = new DesignerPropertyManager(form->core(), this); diff --git a/src/designer/src/components/taskmenu/itemlisteditor.h b/src/designer/src/components/taskmenu/itemlisteditor.h index e9b292446..97bcb19d9 100644 --- a/src/designer/src/components/taskmenu/itemlisteditor.h +++ b/src/designer/src/components/taskmenu/itemlisteditor.h @@ -97,12 +97,12 @@ protected: DesignerIconCache *m_iconCache; DesignerPropertyManager *m_propertyManager; DesignerEditorFactory *m_editorFactory; - QSplitter *m_propertySplitter; + QSplitter *m_propertySplitter = nullptr; QtTreePropertyBrowser *m_propertyBrowser; QList<QtVariantProperty*> m_properties; QList<QtVariantProperty*> m_rootProperties; QHash<QtVariantProperty*, int> m_propertyToRole; - bool m_updatingBrowser; + bool m_updatingBrowser = false; }; class ItemListEditor: public AbstractItemEditor diff --git a/src/designer/src/designer/assistantclient.cpp b/src/designer/src/designer/assistantclient.cpp index 8181f4963..bf8026c3c 100644 --- a/src/designer/src/designer/assistantclient.cpp +++ b/src/designer/src/designer/assistantclient.cpp @@ -42,10 +42,7 @@ QT_BEGIN_NAMESPACE enum { debugAssistantClient = 0 }; -AssistantClient::AssistantClient() : - m_process(0) -{ -} +AssistantClient::AssistantClient() = default; AssistantClient::~AssistantClient() { diff --git a/src/designer/src/designer/assistantclient.h b/src/designer/src/designer/assistantclient.h index 9a6a9d6e8..94618662a 100644 --- a/src/designer/src/designer/assistantclient.h +++ b/src/designer/src/designer/assistantclient.h @@ -64,7 +64,7 @@ private: bool sendCommand(const QString &cmd, QString *errorMessage); bool ensureRunning(QString *errorMessage); - QProcess *m_process; + QProcess *m_process = nullptr; }; QT_END_NAMESPACE diff --git a/src/designer/src/designer/mainwindow.cpp b/src/designer/src/designer/mainwindow.cpp index 2e6d8574e..1e882cc71 100644 --- a/src/designer/src/designer/mainwindow.cpp +++ b/src/designer/src/designer/mainwindow.cpp @@ -79,8 +79,7 @@ static QToolBar *createToolBar(const QString &title, const QString &objectName, // ---------------- MainWindowBase MainWindowBase::MainWindowBase(QWidget *parent, Qt::WindowFlags flags) : - QMainWindow(parent, flags), - m_policy(AcceptCloseEvents) + QMainWindow(parent, flags) { #ifndef Q_OS_MACOS setWindowIcon(qDesigner->windowIcon()); diff --git a/src/designer/src/designer/mainwindow.h b/src/designer/src/designer/mainwindow.h index 79c0ef7ac..9c4687ad6 100644 --- a/src/designer/src/designer/mainwindow.h +++ b/src/designer/src/designer/mainwindow.h @@ -82,7 +82,7 @@ signals: protected: void closeEvent(QCloseEvent *e) override; private: - CloseEventPolicy m_policy; + CloseEventPolicy m_policy = AcceptCloseEvents; }; /* An MdiArea that listens for desktop file manager file drop events and emits diff --git a/src/designer/src/designer/qdesigner_appearanceoptions.cpp b/src/designer/src/designer/qdesigner_appearanceoptions.cpp index 04f3ab1d4..66eb49c9f 100644 --- a/src/designer/src/designer/qdesigner_appearanceoptions.cpp +++ b/src/designer/src/designer/qdesigner_appearanceoptions.cpp @@ -59,8 +59,7 @@ void AppearanceOptions::fromSettings(const QDesignerSettings &settings) // ---------------- QDesignerAppearanceOptionsWidget QDesignerAppearanceOptionsWidget::QDesignerAppearanceOptionsWidget(QWidget *parent) : QWidget(parent), - m_ui(new Ui::AppearanceOptionsWidget), - m_initialUIMode(NeutralMode) + m_ui(new Ui::AppearanceOptionsWidget) { m_ui->setupUi(this); diff --git a/src/designer/src/designer/qdesigner_appearanceoptions.h b/src/designer/src/designer/qdesigner_appearanceoptions.h index 04f5ec3cf..f6936252c 100644 --- a/src/designer/src/designer/qdesigner_appearanceoptions.h +++ b/src/designer/src/designer/qdesigner_appearanceoptions.h @@ -88,7 +88,7 @@ private: UIMode uiMode() const; Ui::AppearanceOptionsWidget *m_ui; - UIMode m_initialUIMode; + UIMode m_initialUIMode = NeutralMode; }; /* The options page for appearance options. */ diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp index 623935380..7ca7155f9 100644 --- a/src/designer/src/designer/qdesigner_workbench.cpp +++ b/src/designer/src/designer/qdesigner_workbench.cpp @@ -167,11 +167,7 @@ static inline QMenu *addMenu(QMenuBar *mb, const QString &title, const ActionLis QDesignerWorkbench::QDesignerWorkbench() : m_core(QDesignerComponents::createFormEditor(this)), m_windowActions(new QActionGroup(this)), - m_globalMenuBar(new QMenuBar), - m_mode(NeutralMode), - m_dockedMainWindow(0), - m_state(StateInitializing), - m_uiSettingsChanged(false) + m_globalMenuBar(new QMenuBar) { QDesignerSettings settings(m_core); diff --git a/src/designer/src/designer/qdesigner_workbench.h b/src/designer/src/designer/qdesigner_workbench.h index 826611a95..9f11ce12f 100644 --- a/src/designer/src/designer/qdesigner_workbench.h +++ b/src/designer/src/designer/qdesigner_workbench.h @@ -162,8 +162,8 @@ private: }; TopLevelData m_topLevelData; - UIMode m_mode; - DockedMainWindow *m_dockedMainWindow; + UIMode m_mode = NeutralMode; + DockedMainWindow *m_dockedMainWindow = nullptr; QVector<QDesignerToolWindow *> m_toolWindows; QVector<QDesignerFormWindow *> m_formWindows; @@ -193,8 +193,8 @@ private: PositionMap m_Positions; enum State { StateInitializing, StateUp, StateClosing }; - State m_state; - bool m_uiSettingsChanged; // UI mode changed in preference dialog, trigger delayed slot. + State m_state = StateInitializing; + bool m_uiSettingsChanged = false; // UI mode changed in preference dialog, trigger delayed slot. }; QT_END_NAMESPACE diff --git a/src/designer/src/designer/versiondialog.cpp b/src/designer/src/designer/versiondialog.cpp index 0e5bb58d1..7ae440664 100644 --- a/src/designer/src/designer/versiondialog.cpp +++ b/src/designer/src/designer/versiondialog.cpp @@ -57,12 +57,12 @@ private: QVector<QPoint> hitPoints; QVector<QPoint> missPoints; QPainterPath m_path; - bool secondStage; - bool m_pushed; + bool secondStage = false; + bool m_pushed = false; }; VersionLabel::VersionLabel(QWidget *parent) - : QLabel(parent), secondStage(false), m_pushed(false) + : QLabel(parent) { setPixmap(QPixmap(QStringLiteral(":/qt-project.org/designer/images/designer.png"))); hitPoints.append(QPoint(56, 25)); diff --git a/src/designer/src/lib/sdk/abstractformeditor.cpp b/src/designer/src/lib/sdk/abstractformeditor.cpp index 9afa36832..40e4bb931 100644 --- a/src/designer/src/lib/sdk/abstractformeditor.cpp +++ b/src/designer/src/lib/sdk/abstractformeditor.cpp @@ -89,26 +89,17 @@ public: QPointer<QDesignerObjectInspectorInterface> m_objectInspector; QPointer<QDesignerIntegrationInterface> m_integration; QPointer<QDesignerActionEditorInterface> m_actionEditor; - QDesignerSettingsInterface *m_settingsManager; - QDesignerPluginManager *m_pluginManager; - QDesignerPromotionInterface *m_promotion; - QDesignerIntrospectionInterface *m_introspection; - QDesignerDialogGuiInterface *m_dialogGui; + QDesignerSettingsInterface *m_settingsManager = nullptr; + QDesignerPluginManager *m_pluginManager = nullptr; + QDesignerPromotionInterface *m_promotion = nullptr; + QDesignerIntrospectionInterface *m_introspection = nullptr; + QDesignerDialogGuiInterface *m_dialogGui = nullptr; QPointer<QtResourceModel> m_resourceModel; QPointer<QtGradientManager> m_gradientManager; // instantiated and deleted by designer_integration QList<QDesignerOptionsPageInterface*> m_optionsPages; }; -QDesignerFormEditorInterfacePrivate::QDesignerFormEditorInterfacePrivate() : - m_settingsManager(0), - m_pluginManager(0), - m_promotion(0), - m_introspection(0), - m_dialogGui(0), - m_resourceModel(0), - m_gradientManager(0) -{ -} +QDesignerFormEditorInterfacePrivate::QDesignerFormEditorInterfacePrivate() = default; QDesignerFormEditorInterfacePrivate::~QDesignerFormEditorInterfacePrivate() { diff --git a/src/designer/src/lib/shared/actionrepository.cpp b/src/designer/src/lib/shared/actionrepository.cpp index cc282ab7b..78ce6f654 100644 --- a/src/designer/src/lib/shared/actionrepository.cpp +++ b/src/designer/src/lib/shared/actionrepository.cpp @@ -69,8 +69,7 @@ namespace qdesigner_internal { // ----------- ActionModel ActionModel::ActionModel(QWidget *parent ) : QStandardItemModel(parent), - m_emptyIcon(emptyIcon()), - m_core(0) + m_emptyIcon(emptyIcon()) { QStringList headers; headers += tr("Name"); diff --git a/src/designer/src/lib/shared/actionrepository_p.h b/src/designer/src/lib/shared/actionrepository_p.h index e8744881e..c84ba00e6 100644 --- a/src/designer/src/lib/shared/actionrepository_p.h +++ b/src/designer/src/lib/shared/actionrepository_p.h @@ -107,7 +107,7 @@ private: const QIcon m_emptyIcon; - QDesignerFormEditorInterface *m_core; + QDesignerFormEditorInterface *m_core = nullptr; }; // Internal class that provides the detailed view of actions. diff --git a/src/designer/src/lib/shared/deviceprofile.cpp b/src/designer/src/lib/shared/deviceprofile.cpp index 07655980b..c2df77ffd 100644 --- a/src/designer/src/lib/shared/deviceprofile.cpp +++ b/src/designer/src/lib/shared/deviceprofile.cpp @@ -75,25 +75,18 @@ namespace qdesigner_internal { // ---------------- DeviceProfileData class DeviceProfileData : public QSharedData { public: - DeviceProfileData(); + DeviceProfileData() = default; void fromSystem(); void clear(); QString m_fontFamily; - int m_fontPointSize; QString m_style; - int m_dpiX; - int m_dpiY; QString m_name; + int m_fontPointSize = -1; + int m_dpiX = -1; + int m_dpiY = -1; }; -DeviceProfileData::DeviceProfileData() : - m_fontPointSize(-1), - m_dpiX(-1), - m_dpiY(-1) -{ -} - void DeviceProfileData::clear() { m_fontPointSize = -1; diff --git a/src/designer/src/lib/shared/dialoggui.cpp b/src/designer/src/lib/shared/dialoggui.cpp index 42438e41d..fc5a42eb0 100644 --- a/src/designer/src/lib/shared/dialoggui.cpp +++ b/src/designer/src/lib/shared/dialoggui.cpp @@ -111,10 +111,7 @@ QIcon IconProvider::icon (const QFileInfo &info) const } // ---------------- DialogGui -DialogGui::DialogGui() : - m_iconProvider(0) -{ -} +DialogGui::DialogGui() = default; DialogGui::~DialogGui() { diff --git a/src/designer/src/lib/shared/dialoggui_p.h b/src/designer/src/lib/shared/dialoggui_p.h index 8a9ce1b17..c6d99e3f0 100644 --- a/src/designer/src/lib/shared/dialoggui_p.h +++ b/src/designer/src/lib/shared/dialoggui_p.h @@ -84,7 +84,7 @@ private: QFileIconProvider *ensureIconProvider(); void initializeImageFileDialog(QFileDialog &fd, QFileDialog::Options options, QFileDialog::FileMode); - QFileIconProvider *m_iconProvider; + QFileIconProvider *m_iconProvider = nullptr; }; } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/iconselector.cpp b/src/designer/src/lib/shared/iconselector.cpp index 139d61b90..d2bf33a13 100644 --- a/src/designer/src/lib/shared/iconselector.cpp +++ b/src/designer/src/lib/shared/iconselector.cpp @@ -176,10 +176,10 @@ static inline QPixmap emptyPixmap() class IconSelectorPrivate { - IconSelector *q_ptr; + IconSelector *q_ptr = nullptr; Q_DECLARE_PUBLIC(IconSelector) public: - IconSelectorPrivate(); + IconSelectorPrivate() = default; void slotStateActivated(); void slotSetActivated(); @@ -195,30 +195,17 @@ public: QMap<int, QPair<QIcon::Mode, QIcon::State> > m_indexToState; const QIcon m_emptyIcon; - QComboBox *m_stateComboBox; - QToolButton *m_iconButton; - QAction *m_resetAction; - QAction *m_resetAllAction; + QComboBox *m_stateComboBox = nullptr; + QToolButton *m_iconButton = nullptr; + QAction *m_resetAction = nullptr; + QAction *m_resetAllAction = nullptr; PropertySheetIconValue m_icon; - DesignerIconCache *m_iconCache; - DesignerPixmapCache *m_pixmapCache; - QtResourceModel *m_resourceModel; - QDesignerFormEditorInterface *m_core; + DesignerIconCache *m_iconCache = nullptr; + DesignerPixmapCache *m_pixmapCache = nullptr; + QtResourceModel *m_resourceModel = nullptr; + QDesignerFormEditorInterface *m_core = nullptr; }; -IconSelectorPrivate::IconSelectorPrivate() : - q_ptr(0), - m_emptyIcon(emptyPixmap()), - m_stateComboBox(0), - m_iconButton(0), - m_resetAction(0), - m_resetAllAction(0), - m_iconCache(0), - m_pixmapCache(0), - m_resourceModel(0), - m_core(0) -{ -} void IconSelectorPrivate::slotUpdate() { QIcon icon; diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp index 00597b856..5c346b367 100644 --- a/src/designer/src/lib/shared/morphmenu.cpp +++ b/src/designer/src/lib/shared/morphmenu.cpp @@ -549,11 +549,7 @@ QStringList MorphWidgetCommand::candidateClasses(QDesignerFormWindowInterface *f // MorphMenu MorphMenu::MorphMenu(QObject *parent) : - QObject(parent), - m_subMenuAction(0), - m_menu(0), - m_widget(0), - m_formWindow(0) + QObject(parent) { } diff --git a/src/designer/src/lib/shared/morphmenu_p.h b/src/designer/src/lib/shared/morphmenu_p.h index b317a37dc..5a26734da 100644 --- a/src/designer/src/lib/shared/morphmenu_p.h +++ b/src/designer/src/lib/shared/morphmenu_p.h @@ -68,10 +68,10 @@ private slots: private: bool populateMenu(QWidget *w, QDesignerFormWindowInterface *fw); - QAction *m_subMenuAction; - QMenu *m_menu; - QWidget *m_widget; - QDesignerFormWindowInterface *m_formWindow; + QAction *m_subMenuAction = nullptr; + QMenu *m_menu = nullptr; + QWidget *m_widget = nullptr; + QDesignerFormWindowInterface *m_formWindow = nullptr; }; } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/qdesigner_command.cpp b/src/designer/src/lib/shared/qdesigner_command.cpp index 51271663c..3ecd994be 100644 --- a/src/designer/src/lib/shared/qdesigner_command.cpp +++ b/src/designer/src/lib/shared/qdesigner_command.cpp @@ -342,10 +342,7 @@ void LowerWidgetCommand::reorder(QWidget *widget) const } // ---- ManageWidgetCommandHelper -ManageWidgetCommandHelper::ManageWidgetCommandHelper() : - m_widget(0) -{ -} +ManageWidgetCommandHelper::ManageWidgetCommandHelper() = default; void ManageWidgetCommandHelper::init(const QDesignerFormWindowInterface *fw, QWidget *widget) { @@ -2332,11 +2329,7 @@ void ListContents::applyToComboBox(QComboBox *comboBox, DesignerIconCache *iconC // --------- TableWidgetContents -TableWidgetContents::TableWidgetContents() : - m_columnCount(0), - m_rowCount(0) -{ -} +TableWidgetContents::TableWidgetContents() = default; void TableWidgetContents::clear() { diff --git a/src/designer/src/lib/shared/qdesigner_command_p.h b/src/designer/src/lib/shared/qdesigner_command_p.h index 8b63279d3..204cf8ddb 100644 --- a/src/designer/src/lib/shared/qdesigner_command_p.h +++ b/src/designer/src/lib/shared/qdesigner_command_p.h @@ -190,7 +190,7 @@ public: const WidgetVector &managedChildren() const { return m_managedChildren; } private: - QWidget *m_widget; + QWidget *m_widget = nullptr; WidgetVector m_managedChildren; }; @@ -894,8 +894,8 @@ struct QDESIGNER_SHARED_EXPORT TableWidgetContents { static QString defaultHeaderText(int i); static void insertHeaderItem(const QTableWidgetItem *item, int i, ListContents *header, bool editor); - int m_columnCount; - int m_rowCount; + int m_columnCount = 0; + int m_rowCount = 0; ListContents m_horizontalHeader; ListContents m_verticalHeader; TableItemMap m_items; @@ -922,14 +922,14 @@ private: struct QDESIGNER_SHARED_EXPORT TreeWidgetContents { struct ItemContents : public ListContents { - ItemContents() : m_itemFlags(-1) {} + ItemContents() = default; ItemContents(const QTreeWidgetItem *item, bool editor); QTreeWidgetItem *createTreeItem(DesignerIconCache *iconCache, bool editor) const; bool operator==(const ItemContents &rhs) const; bool operator!=(const ItemContents &rhs) const { return !(*this == rhs); } - int m_itemFlags; + int m_itemFlags = -1; //bool m_firstColumnSpanned:1; //bool m_hidden:1; //bool m_expanded:1; diff --git a/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp b/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp index 2b2695159..a9126150f 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp +++ b/src/designer/src/lib/shared/qdesigner_formwindowmanager.cpp @@ -49,7 +49,7 @@ using namespace qdesigner_internal; QDesignerFormWindowManager::QDesignerFormWindowManager(QObject *parent) - : QDesignerFormWindowManagerInterface(parent), m_unused(0) + : QDesignerFormWindowManagerInterface(parent) { } diff --git a/src/designer/src/lib/shared/qdesigner_formwindowmanager_p.h b/src/designer/src/lib/shared/qdesigner_formwindowmanager_p.h index 4aed283f6..22226cfc6 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowmanager_p.h +++ b/src/designer/src/lib/shared/qdesigner_formwindowmanager_p.h @@ -65,7 +65,7 @@ public: void showPluginDialog() override; private: - void *m_unused; + void *m_unused = nullptr; }; } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/qdesigner_menu_p.h b/src/designer/src/lib/shared/qdesigner_menu_p.h index 046336530..4933e6319 100644 --- a/src/designer/src/lib/shared/qdesigner_menu_p.h +++ b/src/designer/src/lib/shared/qdesigner_menu_p.h @@ -173,7 +173,7 @@ private: const QPixmap m_subMenuPixmap; QPoint m_startPosition; - int m_currentIndex; + int m_currentIndex = 0; QAction *m_addItem; QAction *m_addSeparator; QHash<QAction*, QDesignerMenu*> m_subMenus; @@ -181,8 +181,8 @@ private: QTimer *m_deactivateWindowTimer; QTimer *m_adjustSizeTimer; QLineEdit *m_editor; - bool m_dragging; - int m_lastSubMenuIndex; + bool m_dragging = false; + int m_lastSubMenuIndex = -1; friend class qdesigner_internal::CreateSubmenuCommand; friend class qdesigner_internal::ActionInsertionCommand; diff --git a/src/designer/src/lib/shared/qdesigner_menubar.cpp b/src/designer/src/lib/shared/qdesigner_menubar.cpp index febc21499..7687e592b 100644 --- a/src/designer/src/lib/shared/qdesigner_menubar.cpp +++ b/src/designer/src/lib/shared/qdesigner_menubar.cpp @@ -78,10 +78,7 @@ SpecialMenuAction::~SpecialMenuAction() = default; QDesignerMenuBar::QDesignerMenuBar(QWidget *parent) : QMenuBar(parent), m_addMenu(new SpecialMenuAction(this)), - m_currentIndex(0), m_editor(new QLineEdit(this)), - m_dragging(false), - m_lastMenuActionIndex( -1), m_promotionTaskMenu(new PromotionTaskMenu(this, PromotionTaskMenu::ModeSingleWidget, this)) { setContextMenuPolicy(Qt::DefaultContextMenu); diff --git a/src/designer/src/lib/shared/qdesigner_menubar_p.h b/src/designer/src/lib/shared/qdesigner_menubar_p.h index 0c9c0253b..5cc299cc5 100644 --- a/src/designer/src/lib/shared/qdesigner_menubar_p.h +++ b/src/designer/src/lib/shared/qdesigner_menubar_p.h @@ -151,10 +151,10 @@ private: QAction *m_addMenu; QPointer<QMenu> m_activeMenu; QPoint m_startPosition; - int m_currentIndex; + int m_currentIndex = 0; QLineEdit *m_editor; - bool m_dragging; - int m_lastMenuActionIndex; + bool m_dragging = false; + int m_lastMenuActionIndex = -1; QPointer<QWidget> m_lastFocusWidget; qdesigner_internal::PromotionTaskMenu* m_promotionTaskMenu; }; diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp index 7c2868c56..d93df7e0e 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -938,12 +938,6 @@ PropertyListCommand::PropertyDescription::PropertyDescription(const QString &pro { } -PropertyListCommand::PropertyDescription::PropertyDescription() : - m_propertyType(QVariant::Invalid), - m_specialProperty(SP_None) -{ -} - void PropertyListCommand::PropertyDescription::debug() const { qDebug() << m_propertyName << m_propertyGroup << m_propertyType << m_specialProperty; diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand_p.h b/src/designer/src/lib/shared/qdesigner_propertycommand_p.h index cc607ae91..2eef88cd7 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand_p.h +++ b/src/designer/src/lib/shared/qdesigner_propertycommand_p.h @@ -182,15 +182,15 @@ protected: // properties of different widgets are equivalent struct PropertyDescription { public: - PropertyDescription(); + PropertyDescription() = default; PropertyDescription(const QString &propertyName, QDesignerPropertySheetExtension *propertySheet, int index); bool equals(const PropertyDescription &p) const; void debug() const; QString m_propertyName; QString m_propertyGroup; - QVariant::Type m_propertyType; - SpecialProperty m_specialProperty; + QVariant::Type m_propertyType = QVariant::Invalid; + SpecialProperty m_specialProperty = SP_None; }; const PropertyDescription &propertyDescription() const { return m_propertyDescription; } diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp index e3806ba96..c226ebae0 100644 --- a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -82,8 +82,7 @@ static const PropertyNameTypeMap &stringPropertyTypes() } QDesignerPropertyEditor::QDesignerPropertyEditor(QWidget *parent, Qt::WindowFlags flags) : - QDesignerPropertyEditorInterface(parent, flags), - m_propertyChangedForwardingBlocked(false) + QDesignerPropertyEditorInterface(parent, flags) { // Make old signal work for compatibility connect(this, &QDesignerPropertyEditorInterface::propertyChanged, diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h b/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h index 7d98e2c86..1cd9f4cc8 100644 --- a/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h +++ b/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h @@ -88,7 +88,7 @@ protected: void emitPropertyValueChanged(const QString &name, const QVariant &value, bool enableSubPropertyHandling); private: - bool m_propertyChangedForwardingBlocked; + bool m_propertyChangedForwardingBlocked = false; }; diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp index ae00b5642..c1628f7ec 100644 --- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -209,16 +209,16 @@ public: enum PropertyKind { NormalProperty, FakeProperty, DynamicProperty, DefaultDynamicProperty }; class Info { public: - Info(); + Info() = default; QString group; QVariant defaultValue; - bool changed; - bool visible; - bool attribute; - bool reset; - PropertyType propertyType; - PropertyKind kind; + bool changed = false; + bool visible = true; + bool attribute = false; + bool reset = true; + PropertyType propertyType = QDesignerPropertySheet::PropertyNone; + PropertyKind kind = NormalProperty; }; Info &ensureInfo(int index); @@ -383,16 +383,6 @@ void QDesignerPropertySheetPrivate::setKeySequenceProperty(int index, const qdes m_keySequenceProperties[index] = value; } -QDesignerPropertySheetPrivate::Info::Info() : - changed(false), - visible(true), - attribute(false), - reset(true), - propertyType(QDesignerPropertySheet::PropertyNone), - kind(NormalProperty) -{ -} - QDesignerPropertySheetPrivate::QDesignerPropertySheetPrivate(QDesignerPropertySheet *sheetPublic, QObject *object, QObject *sheetParent) : q(sheetPublic), m_core(formEditorForObject(sheetParent)), diff --git a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp index f2e4cd5cc..ec1bd5471 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_widgetbox.cpp @@ -126,8 +126,7 @@ bool QDesignerWidgetBoxInterface::Widget::isNull() const namespace qdesigner_internal { QDesignerWidgetBox::QDesignerWidgetBox(QWidget *parent, Qt::WindowFlags flags) - : QDesignerWidgetBoxInterface(parent, flags), - m_loadMode(LoadMerge) + : QDesignerWidgetBoxInterface(parent, flags) { } diff --git a/src/designer/src/lib/shared/qdesigner_widgetbox_p.h b/src/designer/src/lib/shared/qdesigner_widgetbox_p.h index 7a3aaad32..55b6d834d 100644 --- a/src/designer/src/lib/shared/qdesigner_widgetbox_p.h +++ b/src/designer/src/lib/shared/qdesigner_widgetbox_p.h @@ -79,7 +79,7 @@ public: static DomUI *xmlToUi(const QString &name, const QString &xml, bool insertFakeTopLevel); private: - LoadMode m_loadMode; + LoadMode m_loadMode = LoadMerge; }; } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp index 60abbd72a..2c9daa162 100644 --- a/src/designer/src/lib/shared/qlayout_widget.cpp +++ b/src/designer/src/lib/shared/qlayout_widget.cpp @@ -587,7 +587,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const // that do not change the widgets within the layout; also provides some manipulation // functions and ability to apply the state to a layout provided its widgets haven't changed. struct GridLayoutState { - GridLayoutState(); + GridLayoutState() = default; void fromLayout(QGridLayout *l); void applyToLayout(const QDesignerFormEditorInterface *core, QWidget *w) const; @@ -620,8 +620,8 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const WidgetItemMap widgetItemMap; WidgetAlignmentMap widgetAlignmentMap; - int rowCount; - int colCount; + int rowCount = 0; + int colCount = 0; }; static inline bool needsSpacerItem(const GridLayoutState::CellState &cs) { @@ -639,12 +639,6 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const return str; } - GridLayoutState::GridLayoutState() : - rowCount(0), - colCount(0) - { - } - GridLayoutState::CellStates GridLayoutState::cellStates(const QList<QRect> &rects, int numRows, int numColumns) { CellStates rc = CellStates(numRows * numColumns, CellState(Free, Free)); diff --git a/src/designer/src/lib/shared/qtresourceeditordialog.cpp b/src/designer/src/lib/shared/qtresourceeditordialog.cpp index b072b00ad..a7f956c70 100644 --- a/src/designer/src/lib/shared/qtresourceeditordialog.cpp +++ b/src/designer/src/lib/shared/qtresourceeditordialog.cpp @@ -794,7 +794,7 @@ class QtResourceEditorDialogPrivate QtResourceEditorDialog *q_ptr; Q_DECLARE_PUBLIC(QtResourceEditorDialog) public: - QtResourceEditorDialogPrivate(); + QtResourceEditorDialogPrivate() = default; void slotQrcFileInserted(QtQrcFile *qrcFile); void slotQrcFileMoved(QtQrcFile *qrcFile); @@ -853,10 +853,10 @@ public: QString qrcStartDirectory() const; Ui::QtResourceEditorDialog m_ui; - QDesignerFormEditorInterface *m_core; - QtResourceModel *m_resourceModel; - QDesignerDialogGuiInterface *m_dlgGui; - QtQrcManager *m_qrcManager; + QDesignerFormEditorInterface *m_core = nullptr; + QtResourceModel *m_resourceModel = nullptr; + QDesignerDialogGuiInterface *m_dlgGui = nullptr; + QtQrcManager *m_qrcManager = nullptr; QList<QtQrcFileData> m_initialState; QMap<QtQrcFile *, QListWidgetItem *> m_qrcFileToItem; @@ -870,58 +870,30 @@ public: QMap<QStandardItem *, QtResourceFile *> m_pathItemToResourceFile; QMap<QStandardItem *, QtResourceFile *> m_aliasItemToResourceFile; - bool m_ignoreCurrentChanged; - bool m_firstQrcFileDialog; - QtQrcFile *m_currentQrcFile; - - QAction *m_newQrcFileAction; - QAction *m_importQrcFileAction; - QAction *m_removeQrcFileAction; - QAction *m_moveUpQrcFileAction; - QAction *m_moveDownQrcFileAction; - - QAction *m_newPrefixAction; - QAction *m_addResourceFileAction; - QAction *m_changePrefixAction; - QAction *m_changeLanguageAction; - QAction *m_changeAliasAction; - QAction *m_clonePrefixAction; - QAction *m_moveUpAction; - QAction *m_moveDownAction; - QAction *m_removeAction; - - QStandardItemModel *m_treeModel; - QItemSelectionModel *m_treeSelection; + bool m_ignoreCurrentChanged = false; + bool m_firstQrcFileDialog = true; + QtQrcFile *m_currentQrcFile = nullptr; + + QAction *m_newQrcFileAction = nullptr; + QAction *m_importQrcFileAction = nullptr; + QAction *m_removeQrcFileAction = nullptr; + QAction *m_moveUpQrcFileAction = nullptr; + QAction *m_moveDownQrcFileAction = nullptr; + + QAction *m_newPrefixAction = nullptr; + QAction *m_addResourceFileAction = nullptr; + QAction *m_changePrefixAction = nullptr; + QAction *m_changeLanguageAction = nullptr; + QAction *m_changeAliasAction = nullptr; + QAction *m_clonePrefixAction = nullptr; + QAction *m_moveUpAction = nullptr; + QAction *m_moveDownAction = nullptr; + QAction *m_removeAction = nullptr; + + QStandardItemModel *m_treeModel = nullptr; + QItemSelectionModel *m_treeSelection = nullptr; }; -QtResourceEditorDialogPrivate::QtResourceEditorDialogPrivate() : - q_ptr(0), - m_core(0), - m_resourceModel(0), - m_dlgGui(0), - m_qrcManager(0), - m_ignoreCurrentChanged(false), - m_firstQrcFileDialog(true), - m_currentQrcFile(0), - m_newQrcFileAction(0), - m_importQrcFileAction(0), - m_removeQrcFileAction(0), - m_moveUpQrcFileAction(0), - m_moveDownQrcFileAction(0), - m_newPrefixAction(0), - m_addResourceFileAction(0), - m_changePrefixAction(0), - m_changeLanguageAction(0), - m_changeAliasAction(0), - m_clonePrefixAction(0), - m_moveUpAction(0), - m_moveDownAction(0), - m_removeAction(0), - m_treeModel(0), - m_treeSelection(0) -{ -} - QMessageBox::StandardButton QtResourceEditorDialogPrivate::warning(const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton) const { diff --git a/src/designer/src/lib/shared/qtresourcemodel.cpp b/src/designer/src/lib/shared/qtresourcemodel.cpp index e3fa77c69..0675d08d8 100644 --- a/src/designer/src/lib/shared/qtresourcemodel.cpp +++ b/src/designer/src/lib/shared/qtresourcemodel.cpp @@ -63,7 +63,7 @@ QtResourceSetPrivate::QtResourceSetPrivate(QtResourceModel *model) : // -------------------- QtResourceModelPrivate class QtResourceModelPrivate { - QtResourceModel *q_ptr; + QtResourceModel *q_ptr = nullptr; Q_DECLARE_PUBLIC(QtResourceModel) Q_DISABLE_COPY(QtResourceModelPrivate) public: @@ -80,7 +80,7 @@ public: QMap<QtResourceSet *, bool> m_newlyCreated; // all created but not activated yet // (if was active at some point and it's not now it will not be on that map) QMap<QString, QList<QtResourceSet *> > m_pathToResourceSet; - QtResourceSet *m_currentResourceSet; + QtResourceSet *m_currentResourceSet = nullptr; typedef QMap<QString, const QByteArray *> PathDataMap; PathDataMap m_pathToData; @@ -89,8 +89,8 @@ public: QMap<QString, QString> m_fileToQrc; // this map contains the content of active resource set only. // Activating different resource set changes the contents. - QFileSystemWatcher *m_fileWatcher; - bool m_fileWatcherEnabled; + QFileSystemWatcher *m_fileWatcher = nullptr; + bool m_fileWatcherEnabled = true; QMap<QString, bool> m_fileWatchedMap; private: void registerResourceSet(QtResourceSet *resourceSet); @@ -105,13 +105,7 @@ private: void deleteResource(const QByteArray *data) const; }; -QtResourceModelPrivate::QtResourceModelPrivate() : - q_ptr(0), - m_currentResourceSet(0), - m_fileWatcher(0), - m_fileWatcherEnabled(true) -{ -} +QtResourceModelPrivate::QtResourceModelPrivate() = default; // --------------------- QtResourceSet QtResourceSet::QtResourceSet() : diff --git a/src/designer/src/lib/shared/qtresourceview.cpp b/src/designer/src/lib/shared/qtresourceview.cpp index f79926d88..db9e4e4f8 100644 --- a/src/designer/src/lib/shared/qtresourceview.cpp +++ b/src/designer/src/lib/shared/qtresourceview.cpp @@ -123,7 +123,7 @@ void ResourceListWidget::startDrag(Qt::DropActions supportedActions) // ---------------------------- QtResourceViewPrivate class QtResourceViewPrivate { - QtResourceView *q_ptr; + QtResourceView *q_ptr = nullptr; Q_DECLARE_PUBLIC(QtResourceView) public: QtResourceViewPrivate(QDesignerFormEditorInterface *core); @@ -152,12 +152,12 @@ public: QPixmap makeThumbnail(const QPixmap &pix) const; QDesignerFormEditorInterface *m_core; - QtResourceModel *m_resourceModel; + QtResourceModel *m_resourceModel = nullptr; QToolBar *m_toolBar; - QWidget *m_filterWidget; + QWidget *m_filterWidget = nullptr; QTreeWidget *m_treeWidget; QListWidget *m_listWidget; - QSplitter *m_splitter; + QSplitter *m_splitter = nullptr; QMap<QString, QStringList> m_pathToContents; // full path to contents file names (full path to its resource filenames) QMap<QString, QString> m_pathToParentPath; // full path to full parent path QMap<QString, QStringList> m_pathToSubPaths; // full path to full sub paths @@ -165,31 +165,23 @@ public: QMap<QTreeWidgetItem *, QString> m_itemToPath; QMap<QString, QListWidgetItem *> m_resourceToItem; QMap<QListWidgetItem *, QString> m_itemToResource; - QAction *m_editResourcesAction; - QAction *m_reloadResourcesAction; - QAction *m_copyResourcePathAction; + QAction *m_editResourcesAction = nullptr; + QAction *m_reloadResourcesAction = nullptr; + QAction *m_copyResourcePathAction = nullptr; QMap<QString, bool> m_expansionState; - bool m_ignoreGuiSignals; QString m_settingsKey; - bool m_resourceEditingEnabled; QString m_filterPattern; + bool m_ignoreGuiSignals = false; + bool m_resourceEditingEnabled = true; }; QtResourceViewPrivate::QtResourceViewPrivate(QDesignerFormEditorInterface *core) : - q_ptr(0), m_core(core), - m_resourceModel(0), m_toolBar(new QToolBar), m_treeWidget(new QTreeWidget), - m_listWidget(new ResourceListWidget), - m_splitter(0), - m_editResourcesAction(0), - m_reloadResourcesAction(0), - m_copyResourcePathAction(0), - m_ignoreGuiSignals(false), - m_resourceEditingEnabled(true) + m_listWidget(new ResourceListWidget) { m_toolBar->setIconSize(QSize(22, 22)); } diff --git a/src/designer/src/lib/shared/spacer_widget.cpp b/src/designer/src/lib/shared/spacer_widget.cpp index f465ba807..7176b56e7 100644 --- a/src/designer/src/lib/shared/spacer_widget.cpp +++ b/src/designer/src/lib/shared/spacer_widget.cpp @@ -50,12 +50,7 @@ QT_BEGIN_NAMESPACE // should not be applied for pixel-exact design. Spacer::Spacer(QWidget *parent) : - QWidget(parent), - m_SizeOffset(3, 3), // A small offset to ensure the spacer is still visible when reset to size 0,0 - m_orientation(Qt::Vertical), - m_interactive(true), - m_layoutState(UnknownLayoutState), - m_sizeHint(0, 0) + QWidget(parent) { setAttribute(Qt::WA_MouseNoMask); m_formWindow = QDesignerFormWindowInterface::findFormWindow(this); diff --git a/src/designer/src/lib/shared/spacer_widget_p.h b/src/designer/src/lib/shared/spacer_widget_p.h index 8dfccc5b3..e0f30ad65 100644 --- a/src/designer/src/lib/shared/spacer_widget_p.h +++ b/src/designer/src/lib/shared/spacer_widget_p.h @@ -88,14 +88,14 @@ private: bool isInLayout() const; void updateToolTip(); - const QSize m_SizeOffset; + const QSize m_SizeOffset = QSize(3, 3); // A small offset to ensure the spacer is still visible when reset to size 0,0 QDesignerFormWindowInterface *m_formWindow; - Qt::Orientation m_orientation; - bool m_interactive; + Qt::Orientation m_orientation = Qt::Vertical; + bool m_interactive = true; // Cache information about 'being in layout' which is expensive to calculate. enum LayoutState { InLayout, OutsideLayout, UnknownLayoutState }; - mutable LayoutState m_layoutState; - QSize m_sizeHint; + mutable LayoutState m_layoutState = UnknownLayoutState; + QSize m_sizeHint = QSize(0, 0); }; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/textpropertyeditor.cpp b/src/designer/src/lib/shared/textpropertyeditor.cpp index ba289d3c8..f0fcbfdf8 100644 --- a/src/designer/src/lib/shared/textpropertyeditor.cpp +++ b/src/designer/src/lib/shared/textpropertyeditor.cpp @@ -203,10 +203,7 @@ namespace qdesigner_internal { EmbeddingMode embeddingMode, TextPropertyValidationMode validationMode) : QWidget(parent), - m_validationMode(ValidationSingleLine), - m_updateMode(UpdateAsYouType), - m_lineEdit(new PropertyLineEdit(this)), - m_textEdited(false) + m_lineEdit(new PropertyLineEdit(this)) { switch (embeddingMode) { case EmbeddingNone: diff --git a/src/designer/src/lib/shared/textpropertyeditor_p.h b/src/designer/src/lib/shared/textpropertyeditor_p.h index 7b79166a9..25b7f543d 100644 --- a/src/designer/src/lib/shared/textpropertyeditor_p.h +++ b/src/designer/src/lib/shared/textpropertyeditor_p.h @@ -128,13 +128,13 @@ namespace qdesigner_internal { void setRegularExpressionValidator(const QString &pattern); void markIntermediateState(); - TextPropertyValidationMode m_validationMode; - UpdateMode m_updateMode; + TextPropertyValidationMode m_validationMode = ValidationSingleLine; + UpdateMode m_updateMode = UpdateAsYouType; PropertyLineEdit* m_lineEdit; // Cached text containing real newline characters. QString m_cachedText; - bool m_textEdited; + bool m_textEdited = false; }; } diff --git a/src/designer/src/lib/shared/zoomwidget.cpp b/src/designer/src/lib/shared/zoomwidget.cpp index d3e66ab6d..1c7c2f981 100644 --- a/src/designer/src/lib/shared/zoomwidget.cpp +++ b/src/designer/src/lib/shared/zoomwidget.cpp @@ -120,11 +120,7 @@ QVector<int> ZoomMenu::zoomValues() // --------- ZoomView ZoomView::ZoomView(QWidget *parent) : QGraphicsView(parent), - m_scene(new QGraphicsScene(this)), - m_zoom(100), - m_zoomFactor(1.0), - m_zoomContextMenuEnabled(false), - m_zoomMenu(0) + m_scene(new QGraphicsScene(this)) { setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); @@ -285,11 +281,7 @@ bool ZoomedEventFilterRedirector::eventFilter(QObject *watched, QEvent *event) // --------- ZoomWidget ZoomWidget::ZoomWidget(QWidget *parent) : - ZoomView(parent), - m_proxy(0), - m_viewResizeBlocked(false), - m_widgetResizeBlocked(false), - m_widgetZoomContextMenuEnabled(false) + ZoomView(parent) { setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); diff --git a/src/designer/src/lib/shared/zoomwidget_p.h b/src/designer/src/lib/shared/zoomwidget_p.h index c9eb28707..833a605ad 100644 --- a/src/designer/src/lib/shared/zoomwidget_p.h +++ b/src/designer/src/lib/shared/zoomwidget_p.h @@ -127,11 +127,11 @@ protected: private: QGraphicsScene *m_scene; - int m_zoom; - qreal m_zoomFactor; + int m_zoom = 100; + qreal m_zoomFactor = 1; - bool m_zoomContextMenuEnabled; - ZoomMenu *m_zoomMenu; + bool m_zoomContextMenuEnabled = false; + ZoomMenu *m_zoomMenu = nullptr; }; /* The proxy widget used in ZoomWidget. It refuses to move away from 0,0, @@ -204,10 +204,10 @@ private: QSize widgetSize() const; QSizeF widgetDecorationSizeF() const; - QGraphicsProxyWidget *m_proxy; - bool m_viewResizeBlocked; - bool m_widgetResizeBlocked; - bool m_widgetZoomContextMenuEnabled; + QGraphicsProxyWidget *m_proxy = nullptr; + bool m_viewResizeBlocked = false; + bool m_widgetResizeBlocked = false; + bool m_widgetZoomContextMenuEnabled = false; }; } // namespace qdesigner_internal diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index e86ddab1e..38201b912 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -1397,15 +1397,15 @@ DomActionRef *QAbstractFormBuilder::createActionRefDom(QAction *action) // Struct to store layout item parameters for saving layout items struct FormBuilderSaveLayoutEntry { explicit FormBuilderSaveLayoutEntry(QLayoutItem *li = 0) : - item(li), row(-1), column(-1), rowSpan(0), columnSpan(0), alignment(0) {} + item(li) {} void setAlignment(Qt::Alignment al); QLayoutItem *item; - int row; - int column; - int rowSpan; - int columnSpan; + int row = -1; + int column = -1; + int rowSpan = 0; + int columnSpan = 0; Qt::Alignment alignment; }; diff --git a/src/designer/src/lib/uilib/formbuilderextra.cpp b/src/designer/src/lib/uilib/formbuilderextra.cpp index 7025ee479..f38f9f82d 100644 --- a/src/designer/src/lib/uilib/formbuilderextra.cpp +++ b/src/designer/src/lib/uilib/formbuilderextra.cpp @@ -78,10 +78,7 @@ void uiLibWarning(const QString &message) { } -QFormBuilderExtra::CustomWidgetData::CustomWidgetData() : - isContainer(false) -{ -} +QFormBuilderExtra::CustomWidgetData::CustomWidgetData() = default; QFormBuilderExtra::CustomWidgetData::CustomWidgetData(const DomCustomWidget *dcw) : addPageMethod(dcw->elementAddPageMethod()), @@ -93,10 +90,7 @@ QFormBuilderExtra::CustomWidgetData::CustomWidgetData(const DomCustomWidget *dcw QFormBuilderExtra::QFormBuilderExtra() : m_defaultMargin(INT_MIN), m_defaultSpacing(INT_MIN), - m_language(QStringLiteral("c++")), - m_layoutWidget(false), - m_resourceBuilder(0), - m_textBuilder(0) + m_language(QStringLiteral("c++")) { } diff --git a/src/designer/src/lib/uilib/formbuilderextra_p.h b/src/designer/src/lib/uilib/formbuilderextra_p.h index 5c06dc3dc..3b46c966b 100644 --- a/src/designer/src/lib/uilib/formbuilderextra_p.h +++ b/src/designer/src/lib/uilib/formbuilderextra_p.h @@ -111,7 +111,7 @@ public: QString addPageMethod; QString script; QString baseClass; - bool isContainer; + bool isContainer = false; }; void clear(); @@ -198,12 +198,12 @@ private: ButtonGroupHash m_buttonGroups; - bool m_layoutWidget; - QResourceBuilder *m_resourceBuilder; - QTextBuilder *m_textBuilder; + bool m_layoutWidget = false; + QResourceBuilder *m_resourceBuilder = nullptr; + QTextBuilder *m_textBuilder = nullptr; QPointer<QWidget> m_parentWidget; - bool m_parentWidgetIsSet; + bool m_parentWidgetIsSet = false; }; void uiLibWarning(const QString &message); diff --git a/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp b/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp index a843e1052..8e1721a93 100644 --- a/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp +++ b/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.cpp @@ -39,7 +39,6 @@ QT_BEGIN_NAMESPACE QQuickWidgetPlugin::QQuickWidgetPlugin(QObject *parent) : QObject(parent) - , m_initialized(false) { } diff --git a/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.h b/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.h index 1dcc09134..9d5c8a604 100644 --- a/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.h +++ b/src/designer/src/plugins/qquickwidget/qquickwidget_plugin.h @@ -58,7 +58,7 @@ private slots: void sceneGraphError(QQuickWindow::SceneGraphError, const QString &); private: - bool m_initialized; + bool m_initialized = false; }; QT_END_NAMESPACE diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp index 98bebe731..84dc1feff 100644 --- a/src/designer/src/uitools/quiloader.cpp +++ b/src/designer/src/uitools/quiloader.cpp @@ -119,9 +119,6 @@ public: explicit TranslatingTextBuilder(bool idBased, bool trEnabled, const QByteArray &className) : m_idBased(idBased), m_trEnabled(trEnabled), m_className(className) {} - TranslatingTextBuilder(bool trEnabled, const QByteArray &className) : - m_trEnabled(trEnabled), m_className(className) {} - QVariant loadText(const DomProperty *icon) const override; QVariant toNativeValue(const QVariant &value) const override; @@ -336,13 +333,12 @@ class FormBuilderPrivate: public QFormBuilder typedef QFormBuilder ParentClass; public: - QUiLoader *loader; + QUiLoader *loader = nullptr; - bool dynamicTr; - bool trEnabled; + bool dynamicTr = false; + bool trEnabled = true; - FormBuilderPrivate(): loader(nullptr), dynamicTr(false), trEnabled(true), - m_trwatch(nullptr), m_idBased(false) {} + FormBuilderPrivate() = default; QWidget *defaultCreateWidget(const QString &className, QWidget *parent, const QString &name) { @@ -411,8 +407,8 @@ public: private: QByteArray m_class; - TranslationWatcher *m_trwatch; - bool m_idBased; + TranslationWatcher *m_trwatch = nullptr; + bool m_idBased = false; }; static QString convertTranslatable(const DomProperty *p, const QByteArray &className, |