From f562ee4402c957d66f4a5ae5b39cd2679d0c4b24 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 4 Jun 2019 10:11:24 +0200 Subject: Qt Designer: Replace 'typedef' by 'using' Apply Fixits by Qt Creator with some amendments (use Qt standard typedefs for QWidget/QObjectList and QOverload for slots). Change-Id: Icf0600d8e5381e83ae8037895c07a09d7e6b481a Reviewed-by: Jarek Kobus --- .../src/components/buddyeditor/buddyeditor.cpp | 2 +- .../components/formeditor/default_actionprovider.h | 6 ++--- .../src/components/formeditor/default_container.h | 10 ++++----- .../src/components/formeditor/dpi_chooser.cpp | 4 +--- .../components/formeditor/embeddedoptionspage.cpp | 6 ++--- .../src/components/formeditor/formwindow.cpp | 6 ++--- .../src/components/formeditor/formwindowcursor.cpp | 2 +- .../components/formeditor/itemview_propertysheet.h | 6 ++--- .../src/components/formeditor/line_propertysheet.h | 2 +- .../components/formeditor/previewactiongroup.cpp | 4 ++-- .../components/formeditor/qdesigner_resource.cpp | 2 +- .../src/components/formeditor/qdesigner_resource.h | 2 +- .../formeditor/qlayoutwidget_propertysheet.h | 2 +- .../formeditor/qmainwindow_container.cpp | 2 +- .../components/formeditor/qmainwindow_container.h | 2 +- .../components/formeditor/qmdiarea_container.cpp | 2 +- .../src/components/formeditor/qmdiarea_container.h | 4 ++-- .../components/formeditor/qwizard_container.cpp | 4 ++-- .../src/components/formeditor/qwizard_container.h | 6 ++--- .../components/formeditor/spacer_propertysheet.h | 2 +- .../components/objectinspector/objectinspector.cpp | 4 ++-- .../objectinspector/objectinspectormodel.cpp | 8 +++---- .../objectinspector/objectinspectormodel_p.h | 6 ++--- .../propertyeditor/designerpropertymanager.h | 2 +- .../propertyeditor/fontpropertymanager.h | 10 ++++----- .../components/propertyeditor/paletteeditor.cpp | 4 +--- .../components/signalsloteditor/connectdialog.cpp | 2 +- .../signalsloteditor/signalslot_utils.cpp | 2 +- .../signalsloteditor/signalslot_utils_p.h | 2 +- .../signalsloteditor/signalsloteditorwindow.cpp | 10 ++++----- .../src/components/taskmenu/button_taskmenu.cpp | 4 ++-- .../src/components/taskmenu/button_taskmenu.h | 6 ++--- .../components/taskmenu/inplace_widget_helper.cpp | 4 +--- .../src/components/taskmenu/label_taskmenu.h | 2 +- .../src/components/taskmenu/layouttaskmenu.h | 4 ++-- .../src/components/taskmenu/lineedit_taskmenu.h | 2 +- .../src/components/taskmenu/listwidget_taskmenu.h | 2 +- .../src/components/taskmenu/menutaskmenu.h | 4 ++-- .../src/components/taskmenu/tablewidget_taskmenu.h | 2 +- .../src/components/taskmenu/textedit_taskmenu.h | 4 ++-- .../src/components/taskmenu/toolbar_taskmenu.h | 4 ++-- .../widgetbox/widgetboxcategorylistview.cpp | 2 +- .../components/widgetbox/widgetboxtreewidget.cpp | 2 +- .../src/components/widgetbox/widgetboxtreewidget.h | 8 +++---- src/designer/src/designer/appfontdialog.cpp | 6 ++--- src/designer/src/designer/mainwindow.cpp | 2 +- src/designer/src/designer/mainwindow.h | 4 ++-- src/designer/src/designer/qdesigner_actions.cpp | 8 +++---- src/designer/src/designer/qdesigner_workbench.cpp | 2 +- src/designer/src/designer/qdesigner_workbench.h | 2 +- src/designer/src/designer/saveformastemplate.cpp | 4 +--- src/designer/src/lib/extension/qextensionmanager.h | 2 +- src/designer/src/lib/sdk/abstractintegration.cpp | 4 +--- .../src/lib/sdk/abstractpromotioninterface.h | 2 +- src/designer/src/lib/sdk/abstractwidgetbox.h | 4 +--- src/designer/src/lib/shared/actioneditor_p.h | 2 +- src/designer/src/lib/shared/actionrepository_p.h | 6 ++--- src/designer/src/lib/shared/connectionedit_p.h | 8 +++---- src/designer/src/lib/shared/formlayoutmenu.cpp | 5 ++--- src/designer/src/lib/shared/formlayoutmenu_p.h | 2 +- src/designer/src/lib/shared/formwindowbase.cpp | 2 +- src/designer/src/lib/shared/grid.cpp | 2 +- src/designer/src/lib/shared/layout.cpp | 2 +- src/designer/src/lib/shared/morphmenu.cpp | 2 +- src/designer/src/lib/shared/morphmenu_p.h | 2 +- src/designer/src/lib/shared/newformwidget.cpp | 6 ++--- src/designer/src/lib/shared/newformwidget_p.h | 6 ++--- src/designer/src/lib/shared/pluginmanager.cpp | 8 +++---- src/designer/src/lib/shared/pluginmanager_p.h | 2 +- .../src/lib/shared/previewconfigurationwidget.cpp | 6 ++--- src/designer/src/lib/shared/previewmanager.cpp | 6 ++--- src/designer/src/lib/shared/promotionmodel.cpp | 4 ++-- src/designer/src/lib/shared/promotiontaskmenu_p.h | 4 ++-- src/designer/src/lib/shared/qdesigner_command.cpp | 4 ++-- src/designer/src/lib/shared/qdesigner_command_p.h | 18 +++++++-------- src/designer/src/lib/shared/qdesigner_dnditem_p.h | 2 +- .../src/lib/shared/qdesigner_formbuilder_p.h | 2 +- .../src/lib/shared/qdesigner_formwindowcommand.cpp | 2 +- .../src/lib/shared/qdesigner_introspection.cpp | 6 ++--- .../src/lib/shared/qdesigner_introspection_p.h | 2 +- .../src/lib/shared/qdesigner_membersheet.cpp | 5 ++--- src/designer/src/lib/shared/qdesigner_menubar.cpp | 2 +- .../src/lib/shared/qdesigner_promotion.cpp | 6 ++--- .../src/lib/shared/qdesigner_promotiondialog.cpp | 2 +- .../src/lib/shared/qdesigner_propertycommand.cpp | 10 ++++----- .../src/lib/shared/qdesigner_propertycommand_p.h | 18 +++++---------- .../src/lib/shared/qdesigner_propertyeditor.cpp | 4 ++-- .../src/lib/shared/qdesigner_propertyeditor_p.h | 2 +- .../src/lib/shared/qdesigner_propertysheet.cpp | 26 +++++++++++----------- .../src/lib/shared/qdesigner_stackedbox_p.h | 2 +- .../src/lib/shared/qdesigner_tabwidget.cpp | 2 +- .../src/lib/shared/qdesigner_tabwidget_p.h | 2 +- src/designer/src/lib/shared/qdesigner_taskmenu_p.h | 2 +- src/designer/src/lib/shared/qdesigner_toolbar.cpp | 2 +- src/designer/src/lib/shared/qdesigner_toolbox.cpp | 2 +- src/designer/src/lib/shared/qdesigner_toolbox_p.h | 2 +- src/designer/src/lib/shared/qdesigner_utils_p.h | 8 +++---- src/designer/src/lib/shared/qlayout_widget.cpp | 14 ++++++------ src/designer/src/lib/shared/qsimpleresource_p.h | 2 +- src/designer/src/lib/shared/qtresourcemodel.cpp | 2 +- src/designer/src/lib/shared/selectsignaldialog.cpp | 2 +- src/designer/src/lib/shared/shared_settings_p.h | 2 +- src/designer/src/lib/shared/widgetdatabase.cpp | 6 ++--- src/designer/src/lib/shared/widgetdatabase_p.h | 4 ++-- src/designer/src/lib/shared/widgetfactory_p.h | 4 ++-- src/designer/src/lib/shared/zoomwidget.cpp | 4 ++-- src/designer/src/lib/uilib/abstractformbuilder.cpp | 6 ++--- src/designer/src/lib/uilib/abstractformbuilder.h | 4 ++-- src/designer/src/lib/uilib/formbuilderextra_p.h | 10 ++++----- src/designer/src/uitools/quiloader.cpp | 2 +- 110 files changed, 229 insertions(+), 257 deletions(-) diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp index 8218fb43a..7593326db 100644 --- a/src/designer/src/components/buddyeditor/buddyeditor.cpp +++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp @@ -83,7 +83,7 @@ static QString buddy(QLabel *label, QDesignerFormEditorInterface *core) return sheet->property(prop_idx).toString(); } -typedef QList LabelList; +using LabelList = QList; namespace qdesigner_internal { diff --git a/src/designer/src/components/formeditor/default_actionprovider.h b/src/designer/src/components/formeditor/default_actionprovider.h index 85619f33d..15e5683bd 100644 --- a/src/designer/src/components/formeditor/default_actionprovider.h +++ b/src/designer/src/components/formeditor/default_actionprovider.h @@ -107,9 +107,9 @@ private: QMenu *m_widget; }; -typedef ExtensionFactory QToolBarActionProviderFactory; -typedef ExtensionFactory QMenuBarActionProviderFactory; -typedef ExtensionFactory QMenuActionProviderFactory; +using QToolBarActionProviderFactory = ExtensionFactory; +using QMenuBarActionProviderFactory = ExtensionFactory; +using QMenuActionProviderFactory = ExtensionFactory; } // namespace qdesigner_internal diff --git a/src/designer/src/components/formeditor/default_container.h b/src/designer/src/components/formeditor/default_container.h index 337ddc445..f79fbd6e5 100644 --- a/src/designer/src/components/formeditor/default_container.h +++ b/src/designer/src/components/formeditor/default_container.h @@ -191,11 +191,11 @@ public: explicit QDockWidgetContainer(QDockWidget *widget, QObject *parent = nullptr); }; -typedef ExtensionFactory QDesignerStackedWidgetContainerFactory; -typedef ExtensionFactory QDesignerTabWidgetContainerFactory; -typedef ExtensionFactory QDesignerToolBoxContainerFactory; -typedef ExtensionFactory QScrollAreaContainerFactory; -typedef ExtensionFactory QDockWidgetContainerFactory; +using QDesignerStackedWidgetContainerFactory = ExtensionFactory; +using QDesignerTabWidgetContainerFactory = ExtensionFactory; +using QDesignerToolBoxContainerFactory = ExtensionFactory; +using QScrollAreaContainerFactory = ExtensionFactory; +using QDockWidgetContainerFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/dpi_chooser.cpp b/src/designer/src/components/formeditor/dpi_chooser.cpp index d20f2ef05..5e2f9f605 100644 --- a/src/designer/src/components/formeditor/dpi_chooser.cpp +++ b/src/designer/src/components/formeditor/dpi_chooser.cpp @@ -78,8 +78,6 @@ DPI_Chooser::DPI_Chooser(QWidget *parent) : m_dpiXSpinBox(new QSpinBox), m_dpiYSpinBox(new QSpinBox) { - typedef void (QComboBox::*QComboIntSignal)(int); - // Predefined settings: System DeviceProfile::systemResolution(&(m_systemEntry->dpiX), &(m_systemEntry->dpiY)); m_systemEntry->description = nullptr; @@ -96,7 +94,7 @@ DPI_Chooser::DPI_Chooser(QWidget *parent) : setFocusProxy(m_predefinedCombo); m_predefinedCombo->setEditable(false); m_predefinedCombo->setCurrentIndex(0); - connect(m_predefinedCombo, static_cast(&QComboBox::currentIndexChanged), + connect(m_predefinedCombo, QOverload::of(&QComboBox::currentIndexChanged), this, &DPI_Chooser::syncSpinBoxes); // top row with predefined settings QVBoxLayout *vBoxLayout = new QVBoxLayout; diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.cpp b/src/designer/src/components/formeditor/embeddedoptionspage.cpp index 6f70c2872..96a6c7c4a 100644 --- a/src/designer/src/components/formeditor/embeddedoptionspage.cpp +++ b/src/designer/src/components/formeditor/embeddedoptionspage.cpp @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE namespace qdesigner_internal { -typedef QList DeviceProfileList; +using DeviceProfileList = QList; enum { profileComboIndexOffset = 1 }; @@ -137,8 +137,6 @@ EmbeddedOptionsControlPrivate::EmbeddedOptionsControlPrivate(QDesignerFormEditor void EmbeddedOptionsControlPrivate::init(EmbeddedOptionsControl *q) { - typedef void (QComboBox::*QComboIntSignal)(int); - m_q = q; QVBoxLayout *vLayout = new QVBoxLayout; QHBoxLayout *hLayout = new QHBoxLayout; @@ -146,7 +144,7 @@ void EmbeddedOptionsControlPrivate::init(EmbeddedOptionsControl *q) m_profileCombo->setEditable(false); hLayout->addWidget(m_profileCombo); m_profileCombo->addItem(EmbeddedOptionsControl::tr("None")); - EmbeddedOptionsControl::connect(m_profileCombo, static_cast(&QComboBox::currentIndexChanged), + EmbeddedOptionsControl::connect(m_profileCombo, QOverload::of(&QComboBox::currentIndexChanged), m_q, &EmbeddedOptionsControl::slotProfileIndexChanged); m_addButton->setIcon(createIconSet(QString::fromUtf8("plus.png"))); diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp index 41035d722..464d7f618 100644 --- a/src/designer/src/components/formeditor/formwindow.cpp +++ b/src/designer/src/components/formeditor/formwindow.cpp @@ -162,7 +162,7 @@ public: private: - typedef QList SelectionPool; + using SelectionPool = QList; SelectionPool m_selectionPool; typedef QHash SelectionHash; @@ -1137,7 +1137,7 @@ static QSet languageKeywords() bool FormWindow::unify(QObject *w, QString &s, bool changeIt) { - typedef QSet StringSet; + using StringSet = QSet; QWidget *main = mainContainer(); if (!main) @@ -2413,7 +2413,7 @@ void FormWindow::simplifySelection(QWidgetList *sel) const sel->push_back(mainC); return; } - typedef QVector WidgetVector; + using WidgetVector = QVector; WidgetVector toBeRemoved; toBeRemoved.reserve(sel->size()); const QWidgetList::const_iterator scend = sel->constEnd(); diff --git a/src/designer/src/components/formeditor/formwindowcursor.cpp b/src/designer/src/components/formeditor/formwindowcursor.cpp index 0e83de8e8..31dcdfebb 100644 --- a/src/designer/src/components/formeditor/formwindowcursor.cpp +++ b/src/designer/src/components/formeditor/formwindowcursor.cpp @@ -155,7 +155,7 @@ void FormWindowCursor::setProperty(const QString &name, const QVariant &value) const int N = selectedWidgetCount(); Q_ASSERT(N); - SetPropertyCommand::ObjectList selection; + QObjectList selection; for (int i=0; i - QTreeViewPropertySheetFactory; -typedef QDesignerPropertySheetFactory - QTableViewPropertySheetFactory; +using QTreeViewPropertySheetFactory = QDesignerPropertySheetFactory; +using QTableViewPropertySheetFactory = QDesignerPropertySheetFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/line_propertysheet.h b/src/designer/src/components/formeditor/line_propertysheet.h index ebd3960d7..6d0ef613a 100644 --- a/src/designer/src/components/formeditor/line_propertysheet.h +++ b/src/designer/src/components/formeditor/line_propertysheet.h @@ -50,7 +50,7 @@ public: QString propertyGroup(int index) const override; }; -typedef QDesignerPropertySheetFactory LinePropertySheetFactory; +using LinePropertySheetFactory = QDesignerPropertySheetFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/previewactiongroup.cpp b/src/designer/src/components/formeditor/previewactiongroup.cpp index cc6e2dc1e..89c3a0ae7 100644 --- a/src/designer/src/components/formeditor/previewactiongroup.cpp +++ b/src/designer/src/components/formeditor/previewactiongroup.cpp @@ -91,8 +91,8 @@ PreviewActionGroup::PreviewActionGroup(QDesignerFormEditorInterface *core, QObje void PreviewActionGroup::updateDeviceProfiles() { - typedef QList DeviceProfileList; - typedef QList ActionList; + using DeviceProfileList = QList; + using ActionList = QList; const QDesignerSharedSettings settings(m_core); const DeviceProfileList profiles = settings.deviceProfiles(); diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp index 72ad5ab2a..bfb86ee33 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.cpp +++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp @@ -108,7 +108,7 @@ Q_DECLARE_METATYPE(QWidgetList) QT_BEGIN_NAMESPACE namespace { - typedef QList DomPropertyList; + using DomPropertyList = QList; } static const char *currentUiVersion = "4.0"; diff --git a/src/designer/src/components/formeditor/qdesigner_resource.h b/src/designer/src/components/formeditor/qdesigner_resource.h index c0e925f87..d667f1372 100644 --- a/src/designer/src/components/formeditor/qdesigner_resource.h +++ b/src/designer/src/components/formeditor/qdesigner_resource.h @@ -145,7 +145,7 @@ private: QStringList mergeWithLoadedPaths(const QStringList &paths) const; void applyAttributesToPropertySheet(const DomWidget *ui_widget, QWidget *widget); - typedef QList DomCustomWidgetList; + using DomCustomWidgetList = QList; void addCustomWidgetsToWidgetDatabase(DomCustomWidgetList& list); FormWindow *m_formWindow; bool m_isMainWidget; diff --git a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.h b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.h index e50df88f4..f0a66787e 100644 --- a/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.h +++ b/src/designer/src/components/formeditor/qlayoutwidget_propertysheet.h @@ -51,7 +51,7 @@ public: bool dynamicPropertiesAllowed() const override; }; -typedef QDesignerPropertySheetFactory QLayoutWidgetPropertySheetFactory; +using QLayoutWidgetPropertySheetFactory = QDesignerPropertySheetFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/qmainwindow_container.cpp b/src/designer/src/components/formeditor/qmainwindow_container.cpp index cf0cbdaa1..180c38e79 100644 --- a/src/designer/src/components/formeditor/qmainwindow_container.cpp +++ b/src/designer/src/components/formeditor/qmainwindow_container.cpp @@ -74,7 +74,7 @@ void QMainWindowContainer::setCurrentIndex(int index) namespace { // Pair of - typedef QPair ToolBarData; + using ToolBarData = QPair ; ToolBarData toolBarData(QToolBar *me) { const QMainWindow *mw = qobject_cast(me->parentWidget()); diff --git a/src/designer/src/components/formeditor/qmainwindow_container.h b/src/designer/src/components/formeditor/qmainwindow_container.h index 96991f411..9551d8ffa 100644 --- a/src/designer/src/components/formeditor/qmainwindow_container.h +++ b/src/designer/src/components/formeditor/qmainwindow_container.h @@ -60,7 +60,7 @@ private: QWidgetList m_widgets; }; -typedef ExtensionFactory QMainWindowContainerFactory; +using QMainWindowContainerFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp index 2726cfcee..e33c99367 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.cpp +++ b/src/designer/src/components/formeditor/qmdiarea_container.cpp @@ -142,7 +142,7 @@ QMdiAreaPropertySheet::QMdiAreaPropertySheet(QWidget *mdiArea, QObject *parent) QMdiAreaPropertySheet::MdiAreaProperty QMdiAreaPropertySheet::mdiAreaProperty(const QString &name) { - typedef QHash MdiAreaPropertyHash; + using MdiAreaPropertyHash = QHash; static MdiAreaPropertyHash mdiAreaPropertyHash; if (mdiAreaPropertyHash.empty()) { mdiAreaPropertyHash.insert(QLatin1String(subWindowNameC), MdiAreaSubWindowName); diff --git a/src/designer/src/components/formeditor/qmdiarea_container.h b/src/designer/src/components/formeditor/qmdiarea_container.h index 47669af3a..6bca44840 100644 --- a/src/designer/src/components/formeditor/qmdiarea_container.h +++ b/src/designer/src/components/formeditor/qmdiarea_container.h @@ -94,8 +94,8 @@ private: // Factories -typedef ExtensionFactory QMdiAreaContainerFactory; -typedef QDesignerPropertySheetFactory QMdiAreaPropertySheetFactory; +using QMdiAreaContainerFactory = ExtensionFactory; +using QMdiAreaPropertySheetFactory = QDesignerPropertySheetFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/qwizard_container.cpp b/src/designer/src/components/formeditor/qwizard_container.cpp index 36e73c6ea..dbc7084eb 100644 --- a/src/designer/src/components/formeditor/qwizard_container.cpp +++ b/src/designer/src/components/formeditor/qwizard_container.cpp @@ -36,8 +36,8 @@ QT_BEGIN_NAMESPACE -typedef QList IdList; -typedef QList WizardPageList; +using IdList = QList; +using WizardPageList = QList; namespace qdesigner_internal { diff --git a/src/designer/src/components/formeditor/qwizard_container.h b/src/designer/src/components/formeditor/qwizard_container.h index fe7cdbc2f..0c4241ea0 100644 --- a/src/designer/src/components/formeditor/qwizard_container.h +++ b/src/designer/src/components/formeditor/qwizard_container.h @@ -99,9 +99,9 @@ private: }; // Factories -typedef QDesignerPropertySheetFactory QWizardPropertySheetFactory; -typedef QDesignerPropertySheetFactory QWizardPagePropertySheetFactory; -typedef ExtensionFactory QWizardContainerFactory; +using QWizardPropertySheetFactory = QDesignerPropertySheetFactory; +using QWizardPagePropertySheetFactory = QDesignerPropertySheetFactory; +using QWizardContainerFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/formeditor/spacer_propertysheet.h b/src/designer/src/components/formeditor/spacer_propertysheet.h index 05dfb7d32..a2b00dbdb 100644 --- a/src/designer/src/components/formeditor/spacer_propertysheet.h +++ b/src/designer/src/components/formeditor/spacer_propertysheet.h @@ -51,7 +51,7 @@ public: bool dynamicPropertiesAllowed() const override; }; -typedef QDesignerPropertySheetFactory SpacerPropertySheetFactory; +using SpacerPropertySheetFactory = QDesignerPropertySheetFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/objectinspector/objectinspector.cpp b/src/designer/src/components/objectinspector/objectinspector.cpp index 32e9bc987..4267fea22 100644 --- a/src/designer/src/components/objectinspector/objectinspector.cpp +++ b/src/designer/src/components/objectinspector/objectinspector.cpp @@ -90,7 +90,7 @@ namespace { // A widget managed by the form window cursor ManagedWidgetSelection }; - typedef QVector QObjectVector; + using QObjectVector = QVector; } static inline SelectionType selectionType(const QDesignerFormWindowInterface *fw, QObject *o) @@ -421,7 +421,7 @@ bool ObjectInspector::ObjectInspectorPrivate::selectObject(QObject *o) if (!m_core->metaDataBase()->item(o)) return false; - typedef QSet ModelIndexSet; + using ModelIndexSet = QSet; const QModelIndexList objectIndexes = indexesOf(o); if (objectIndexes.empty()) diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp index 72b905ecf..6baf4bcdc 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp +++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp @@ -260,7 +260,7 @@ namespace qdesigner_internal { setItemsDisplayData(row, icons, ClassNameChanged|ObjectNameChanged|ClassIconChanged|TypeChanged|LayoutTypeChanged); } - typedef QList ObjectModel; + using ObjectModel = QList; // Recursive routine that creates the model by traversing the form window object tree. void createModelRecursion(const QDesignerFormWindowInterface *fwi, @@ -269,8 +269,8 @@ namespace qdesigner_internal { ObjectModel &model, const ModelRecursionContext &ctx) { - typedef QList ButtonGroupList; - typedef QList ActionList; + using ButtonGroupList = QList; + using ActionList = QList; // 1) Create entry const ObjectData entry(parent, object, ctx); @@ -442,7 +442,7 @@ namespace qdesigner_internal { { // Change text and icon. Keep a set of changed object // as for example actions might occur several times in the tree. - typedef QSet QObjectSet; + using QObjectSet = QSet; QObjectSet changedObjects; diff --git a/src/designer/src/components/objectinspector/objectinspectormodel_p.h b/src/designer/src/components/objectinspector/objectinspectormodel_p.h index 5a4593e6c..f138253a5 100644 --- a/src/designer/src/components/objectinspector/objectinspectormodel_p.h +++ b/src/designer/src/components/objectinspector/objectinspectormodel_p.h @@ -75,7 +75,7 @@ namespace qdesigner_internal { ExtensionContainer // QTabWidget and the like, container extension }; - typedef QList StandardItemList; + using StandardItemList = QList; explicit ObjectData(QObject *parent, QObject *object, const ModelRecursionContext &ctx); ObjectData(); @@ -114,13 +114,13 @@ namespace qdesigner_internal { inline bool operator==(const ObjectData &e1, const ObjectData &e2) { return e1.equals(e2); } inline bool operator!=(const ObjectData &e1, const ObjectData &e2) { return !e1.equals(e2); } - typedef QList ObjectModel; + using ObjectModel = QList; // QStandardItemModel for ObjectInspector. Uses ObjectData/ObjectModel // internally for its updates. class ObjectInspectorModel : public QStandardItemModel { public: - typedef QList StandardItemList; + using StandardItemList = QList; enum { ObjectNameColumn, ClassNameColumn, NumColumns }; explicit ObjectInspectorModel(QObject *parent); diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.h b/src/designer/src/components/propertyeditor/designerpropertymanager.h index ee3652c69..8fa974117 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.h +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.h @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE typedef QPair DesignerIntPair; -typedef QList DesignerFlagList; +using DesignerFlagList = QList; class QDesignerFormEditorInterface; class QLineEdit; diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.h b/src/designer/src/components/propertyeditor/fontpropertymanager.h index 13d0e52c7..1041cd357 100644 --- a/src/designer/src/components/propertyeditor/fontpropertymanager.h +++ b/src/designer/src/components/propertyeditor/fontpropertymanager.h @@ -55,8 +55,8 @@ class FontPropertyManager { public: FontPropertyManager(); - typedef QMap ResetMap; - typedef QMap NameMap; + using ResetMap = QMap; + using NameMap = QMap; // Call before QtVariantPropertyManager::initializeProperty. void preInitializeProperty(QtProperty *property, int type, ResetMap &resetMap); @@ -80,9 +80,9 @@ public: static bool readFamilyMapping(NameMap *rc, QString *errorMessage); private: - typedef QMap PropertyToPropertyMap; - typedef QList PropertyList; - typedef QMap PropertyToSubPropertiesMap; + using PropertyToPropertyMap = QMap; + using PropertyList = QList; + using PropertyToSubPropertiesMap = QMap; void removeAntialiasingProperty(QtProperty *); void updateModifiedState(QtProperty *property, const QVariant &value); diff --git a/src/designer/src/components/propertyeditor/paletteeditor.cpp b/src/designer/src/components/propertyeditor/paletteeditor.cpp index 89a3a4a19..4bb1bf450 100644 --- a/src/designer/src/components/propertyeditor/paletteeditor.cpp +++ b/src/designer/src/components/propertyeditor/paletteeditor.cpp @@ -500,10 +500,8 @@ QWidget *ColorDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem //editor->installEventFilter(const_cast(this)); ed = editor; } else { - typedef void (BrushEditor::*BrushEditorWidgetSignal)(QWidget *); - BrushEditor *editor = new BrushEditor(m_core, parent); - connect(editor, static_cast(&BrushEditor::changed), + connect(editor, QOverload::of(&BrushEditor::changed), this, &ColorDelegate::commitData); editor->setFocusPolicy(Qt::NoFocus); editor->installEventFilter(const_cast(this)); diff --git a/src/designer/src/components/signalsloteditor/connectdialog.cpp b/src/designer/src/components/signalsloteditor/connectdialog.cpp index 34c7d9e68..571ddba12 100644 --- a/src/designer/src/components/signalsloteditor/connectdialog.cpp +++ b/src/designer/src/components/signalsloteditor/connectdialog.cpp @@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE namespace { - typedef QList ListWidgetItems; + using ListWidgetItems = QList; } static QString realClassName(QDesignerFormEditorInterface *core, QWidget *widget) diff --git a/src/designer/src/components/signalsloteditor/signalslot_utils.cpp b/src/designer/src/components/signalsloteditor/signalslot_utils.cpp index 72cd292b8..f913b5bdf 100644 --- a/src/designer/src/components/signalsloteditor/signalslot_utils.cpp +++ b/src/designer/src/components/signalsloteditor/signalslot_utils.cpp @@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE -typedef QPair ClassNameSignaturePair; +using ClassNameSignaturePair = QPair; // Find all member functions that match a predicate on the signature string // using the member sheet and the fake methods stored in the widget diff --git a/src/designer/src/components/signalsloteditor/signalslot_utils_p.h b/src/designer/src/components/signalsloteditor/signalslot_utils_p.h index 7fb6166d5..acc240a43 100644 --- a/src/designer/src/components/signalsloteditor/signalslot_utils_p.h +++ b/src/designer/src/components/signalsloteditor/signalslot_utils_p.h @@ -71,7 +71,7 @@ struct ClassMemberFunctions QStringList m_memberList; }; -typedef QList ClassesMemberFunctions; +using ClassesMemberFunctions = QList; // Return classes and members in reverse class order to // populate of the combo of the ToolWindow. diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp index 2ec519261..f44c3cd5a 100644 --- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp +++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp @@ -65,8 +65,6 @@ QT_BEGIN_NAMESPACE -typedef void (QComboBox::*QComboIntSignal)(int); - // Add suitable form widgets to a list of objects for the signal slot // editor. Prevent special widgets from showing up there. static void addWidgetToObjectList(const QWidget *w, QStringList &r) @@ -81,8 +79,8 @@ static void addWidgetToObjectList(const QWidget *w, QStringList &r) static QStringList objectNameList(QDesignerFormWindowInterface *form) { - typedef QList ActionList; - typedef QList ButtonGroupList; + using ActionList = QList; + using ButtonGroupList = QList; QStringList result; @@ -519,7 +517,7 @@ InlineEditor::InlineEditor(QWidget *parent) : setModel(m_model = new InlineEditorModel(0, 4, this)); setFrame(false); m_idx = -1; - connect(this, static_cast(&QComboBox::activated), + connect(this, QOverload::of(&QComboBox::activated), this, &InlineEditor::checkSelection); } @@ -657,7 +655,7 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, break; } - connect(inline_editor, static_cast(&QComboBox::activated), + connect(inline_editor, QOverload::of(&QComboBox::activated), this, &ConnectionDelegate::emitCommitData); return inline_editor; diff --git a/src/designer/src/components/taskmenu/button_taskmenu.cpp b/src/designer/src/components/taskmenu/button_taskmenu.cpp index b9860f67b..5791c6991 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.cpp +++ b/src/designer/src/components/taskmenu/button_taskmenu.cpp @@ -56,8 +56,8 @@ namespace qdesigner_internal { enum { debugButtonMenu = 0 }; -typedef QList ButtonList; -typedef QList ButtonGroupList; +using ButtonList = QList; +using ButtonGroupList = QList; // ButtonGroupCommand: Base for commands handling button groups and button lists // addButtonsToGroup() and removeButtonsFromGroup() are low-level helpers for diff --git a/src/designer/src/components/taskmenu/button_taskmenu.h b/src/designer/src/components/taskmenu/button_taskmenu.h index 994cf3dd7..ab58c0630 100644 --- a/src/designer/src/components/taskmenu/button_taskmenu.h +++ b/src/designer/src/components/taskmenu/button_taskmenu.h @@ -147,9 +147,9 @@ public: explicit CommandLinkButtonTaskMenu(QCommandLinkButton *button, QObject *parent = nullptr); }; -typedef ExtensionFactory ButtonGroupTaskMenuFactory; -typedef ExtensionFactory CommandLinkButtonTaskMenuFactory; -typedef ExtensionFactory ButtonTaskMenuFactory; +using ButtonGroupTaskMenuFactory = ExtensionFactory; +using CommandLinkButtonTaskMenuFactory = ExtensionFactory; +using ButtonTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/inplace_widget_helper.cpp b/src/designer/src/components/taskmenu/inplace_widget_helper.cpp index d96fd915b..44145bdba 100644 --- a/src/designer/src/components/taskmenu/inplace_widget_helper.cpp +++ b/src/designer/src/components/taskmenu/inplace_widget_helper.cpp @@ -43,14 +43,12 @@ namespace qdesigner_internal { m_parentWidget(parentWidget), m_noChildEvent(m_parentWidget->testAttribute(Qt::WA_NoChildEventsForParent)) { - typedef void (QWidget::*QWidgetVoidSlot)(); - m_editorWidget->setAttribute(Qt::WA_DeleteOnClose); m_editorWidget->setParent(m_parentWidget->window()); m_parentWidget->installEventFilter(this); m_editorWidget->installEventFilter(this); connect(m_editorWidget, &QObject::destroyed, - fw->mainContainer(), static_cast(&QWidget::setFocus)); + fw->mainContainer(), QOverload<>::of(&QWidget::setFocus)); } InPlaceWidgetHelper::~InPlaceWidgetHelper() diff --git a/src/designer/src/components/taskmenu/label_taskmenu.h b/src/designer/src/components/taskmenu/label_taskmenu.h index a47cc7e6b..a1744b583 100644 --- a/src/designer/src/components/taskmenu/label_taskmenu.h +++ b/src/designer/src/components/taskmenu/label_taskmenu.h @@ -60,7 +60,7 @@ private: QAction *m_editPlainTextAction; }; -typedef ExtensionFactory LabelTaskMenuFactory; +using LabelTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/layouttaskmenu.h b/src/designer/src/components/taskmenu/layouttaskmenu.h index f7ccc2c73..afd1afe0f 100644 --- a/src/designer/src/components/taskmenu/layouttaskmenu.h +++ b/src/designer/src/components/taskmenu/layouttaskmenu.h @@ -72,8 +72,8 @@ public: }; -typedef qdesigner_internal::ExtensionFactory LayoutWidgetTaskMenuFactory; -typedef qdesigner_internal::ExtensionFactory SpacerTaskMenuFactory; +using LayoutWidgetTaskMenuFactory = qdesigner_internal::ExtensionFactory; +using SpacerTaskMenuFactory = qdesigner_internal::ExtensionFactory; QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/lineedit_taskmenu.h b/src/designer/src/components/taskmenu/lineedit_taskmenu.h index fb7aae81f..e28ab7336 100644 --- a/src/designer/src/components/taskmenu/lineedit_taskmenu.h +++ b/src/designer/src/components/taskmenu/lineedit_taskmenu.h @@ -53,7 +53,7 @@ private: QAction *m_editTextAction; }; -typedef ExtensionFactory LineEditTaskMenuFactory; +using LineEditTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/listwidget_taskmenu.h b/src/designer/src/components/taskmenu/listwidget_taskmenu.h index 799710f11..63708be61 100644 --- a/src/designer/src/components/taskmenu/listwidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/listwidget_taskmenu.h @@ -64,7 +64,7 @@ private: QAction *m_editItemsAction; }; -typedef ExtensionFactory ListWidgetTaskMenuFactory; +using ListWidgetTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/menutaskmenu.h b/src/designer/src/components/taskmenu/menutaskmenu.h index fa272f515..935836896 100644 --- a/src/designer/src/components/taskmenu/menutaskmenu.h +++ b/src/designer/src/components/taskmenu/menutaskmenu.h @@ -83,8 +83,8 @@ private: QDesignerMenuBar *m_bar; }; -typedef ExtensionFactory MenuTaskMenuFactory; -typedef ExtensionFactory MenuBarTaskMenuFactory; +using MenuTaskMenuFactory = ExtensionFactory; +using MenuBarTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal diff --git a/src/designer/src/components/taskmenu/tablewidget_taskmenu.h b/src/designer/src/components/taskmenu/tablewidget_taskmenu.h index 1d76ad5f9..b4d5462f2 100644 --- a/src/designer/src/components/taskmenu/tablewidget_taskmenu.h +++ b/src/designer/src/components/taskmenu/tablewidget_taskmenu.h @@ -64,7 +64,7 @@ private: QAction *m_editItemsAction; }; -typedef ExtensionFactory TableWidgetTaskMenuFactory; +using TableWidgetTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/textedit_taskmenu.h b/src/designer/src/components/taskmenu/textedit_taskmenu.h index fdc206be9..2e50b8ca1 100644 --- a/src/designer/src/components/taskmenu/textedit_taskmenu.h +++ b/src/designer/src/components/taskmenu/textedit_taskmenu.h @@ -67,8 +67,8 @@ private: QAction *m_editTextAction; }; -typedef ExtensionFactory TextEditTaskMenuFactory; -typedef ExtensionFactory PlainTextEditTaskMenuFactory; +using TextEditTaskMenuFactory = ExtensionFactory; +using PlainTextEditTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal QT_END_NAMESPACE diff --git a/src/designer/src/components/taskmenu/toolbar_taskmenu.h b/src/designer/src/components/taskmenu/toolbar_taskmenu.h index e81997f5e..3e8d5909b 100644 --- a/src/designer/src/components/taskmenu/toolbar_taskmenu.h +++ b/src/designer/src/components/taskmenu/toolbar_taskmenu.h @@ -76,8 +76,8 @@ private: PromotionTaskMenu *m_promotionTaskMenu; }; -typedef ExtensionFactory ToolBarTaskMenuFactory; -typedef ExtensionFactory StatusBarTaskMenuFactory; +using ToolBarTaskMenuFactory = ExtensionFactory; +using StatusBarTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp index f103cb006..5b00ea68f 100644 --- a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp +++ b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp @@ -129,7 +129,7 @@ public: bool removeCustomWidgets(); private: - typedef QList WidgetBoxCategoryEntrys; + using WidgetBoxCategoryEntrys = QList; QDesignerFormEditorInterface *m_core; WidgetBoxCategoryEntrys m_items; diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp index df59c392c..dd17b3a4e 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp @@ -152,7 +152,7 @@ void WidgetBoxTreeWidget::saveExpandedState() const void WidgetBoxTreeWidget::restoreExpandedState() { - typedef QSet StringSet; + using StringSet = QSet; QDesignerSettingsInterface *settings = m_core->settingsManager(); const QString groupKey = QLatin1String(widgetBoxSettingsGroupC) + QLatin1Char('/'); m_iconMode = settings->value(groupKey + QLatin1String(widgetBoxViewModeKeyC)).toBool(); diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.h b/src/designer/src/components/widgetbox/widgetboxtreewidget.h index a770a19e7..99d15314f 100644 --- a/src/designer/src/components/widgetbox/widgetboxtreewidget.h +++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.h @@ -55,9 +55,9 @@ class WidgetBoxTreeWidget : public QTreeWidget Q_OBJECT public: - typedef QDesignerWidgetBoxInterface::Widget Widget; - typedef QDesignerWidgetBoxInterface::Category Category; - typedef QDesignerWidgetBoxInterface::CategoryList CategoryList; + using Widget = QDesignerWidgetBoxInterface::Widget; + using Category = QDesignerWidgetBoxInterface::Category; + using CategoryList = QDesignerWidgetBoxInterface::CategoryList; explicit WidgetBoxTreeWidget(QDesignerFormEditorInterface *core, QWidget *parent = nullptr); ~WidgetBoxTreeWidget(); @@ -123,7 +123,7 @@ private: QDesignerFormEditorInterface *m_core; QString m_file_name; - typedef QHash IconCache; + using IconCache = QHash; mutable IconCache m_pluginIcons; bool m_iconMode; QTimer *m_scratchPadDeleteTimer; diff --git a/src/designer/src/designer/appfontdialog.cpp b/src/designer/src/designer/appfontdialog.cpp index e8df6efe8..c7608acad 100644 --- a/src/designer/src/designer/appfontdialog.cpp +++ b/src/designer/src/designer/appfontdialog.cpp @@ -81,8 +81,8 @@ public: bool removeAt(int index, QString *errorMessage); // Store loaded fonts as pair of file name and Id - typedef QPair FileNameFontIdPair; - typedef QList FileNameFontIdPairs; + using FileNameFontIdPair = QPair; + using FileNameFontIdPairs = QList; const FileNameFontIdPairs &fonts() const; private: @@ -230,7 +230,7 @@ AppFontModel::AppFontModel(QObject * parent) : void AppFontModel::init(const AppFontManager &mgr) { - typedef AppFontManager::FileNameFontIdPairs FileNameFontIdPairs; + using FileNameFontIdPairs = AppFontManager::FileNameFontIdPairs; const FileNameFontIdPairs &fonts = mgr.fonts(); const FileNameFontIdPairs::const_iterator cend = fonts.constEnd(); diff --git a/src/designer/src/designer/mainwindow.cpp b/src/designer/src/designer/mainwindow.cpp index d856e396e..3a1ae3ce9 100644 --- a/src/designer/src/designer/mainwindow.cpp +++ b/src/designer/src/designer/mainwindow.cpp @@ -56,7 +56,7 @@ static const char *uriListMimeFormatC = "text/uri-list"; QT_BEGIN_NAMESPACE -typedef QList ActionList; +using ActionList = QList; // Helpers for creating toolbars and menu diff --git a/src/designer/src/designer/mainwindow.h b/src/designer/src/designer/mainwindow.h index f080b7c90..3bbfbb7fd 100644 --- a/src/designer/src/designer/mainwindow.h +++ b/src/designer/src/designer/mainwindow.h @@ -141,8 +141,8 @@ class DockedMainWindow : public MainWindowBase { Q_OBJECT Q_DISABLE_COPY_MOVE(DockedMainWindow) public: - typedef QVector DesignerToolWindowList; - typedef QVector DockWidgetList; + using DesignerToolWindowList = QVector; + using DockWidgetList = QVector; explicit DockedMainWindow(QDesignerWorkbench *wb, QMenu *toolBarMenu, diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 5ac2c565c..970599f14 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -194,8 +194,6 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) m_preferencesAction(new QAction(tr("Preferences..."), this)), m_appFontAction(new QAction(tr("Additional Fonts..."), this)) { - typedef void (QDesignerActions::*VoidSlot)(); - #if defined (Q_OS_UNIX) && !defined(Q_OS_MACOS) m_newFormAction->setIcon(QIcon::fromTheme(QStringLiteral("document-new"), m_newFormAction->icon())); m_openFormAction->setIcon(QIcon::fromTheme(QStringLiteral("document-open"), m_openFormAction->icon())); @@ -255,10 +253,12 @@ QDesignerActions::QDesignerActions(QDesignerWorkbench *workbench) m_fileActions->addAction(createSeparator(this)); m_saveFormAction->setShortcut(QKeySequence::Save); - connect(m_saveFormAction, &QAction::triggered, this, static_cast(&QDesignerActions::saveForm)); + connect(m_saveFormAction, &QAction::triggered, this, + QOverload<>::of(&QDesignerActions::saveForm)); m_fileActions->addAction(m_saveFormAction); - connect(m_saveFormAsAction, &QAction::triggered, this, static_cast(&QDesignerActions::saveFormAs)); + connect(m_saveFormAsAction, &QAction::triggered, this, + QOverload<>::of(&QDesignerActions::saveFormAs)); m_fileActions->addAction(m_saveFormAsAction); #ifdef Q_OS_MACOS diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp index 2de61bea1..f2a8b5d1c 100644 --- a/src/designer/src/designer/qdesigner_workbench.cpp +++ b/src/designer/src/designer/qdesigner_workbench.cpp @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE static const char *appFontPrefixC = "AppFonts"; -typedef QList ActionList; +using ActionList = QList; static QMdiSubWindow *mdiSubWindowOf(const QWidget *w) { diff --git a/src/designer/src/designer/qdesigner_workbench.h b/src/designer/src/designer/qdesigner_workbench.h index 9f11ce12f..fea02d59f 100644 --- a/src/designer/src/designer/qdesigner_workbench.h +++ b/src/designer/src/designer/qdesigner_workbench.h @@ -189,7 +189,7 @@ private: // main window in MDI mode) QPoint m_position; }; - typedef QHash PositionMap; + using PositionMap = QHash; PositionMap m_Positions; enum State { StateInitializing, StateUp, StateClosing }; diff --git a/src/designer/src/designer/saveformastemplate.cpp b/src/designer/src/designer/saveformastemplate.cpp index 637d7a433..4b338308e 100644 --- a/src/designer/src/designer/saveformastemplate.cpp +++ b/src/designer/src/designer/saveformastemplate.cpp @@ -46,8 +46,6 @@ SaveFormAsTemplate::SaveFormAsTemplate(QDesignerFormEditorInterface *core, m_core(core), m_formWindow(formWindow) { - typedef void (QComboBox::*QComboIntSignal)(int); - ui.setupUi(this); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); @@ -62,7 +60,7 @@ SaveFormAsTemplate::SaveFormAsTemplate(QDesignerFormEditorInterface *core, m_addPathIndex = ui.categoryCombo->count() - 1; connect(ui.templateNameEdit, &QLineEdit::textChanged, this, &SaveFormAsTemplate::updateOKButton); - connect(ui.categoryCombo, static_cast(&QComboBox::activated), + connect(ui.categoryCombo, QOverload::of(&QComboBox::activated), this, &SaveFormAsTemplate::checkToAddPath); } diff --git a/src/designer/src/lib/extension/qextensionmanager.h b/src/designer/src/lib/extension/qextensionmanager.h index c283a11cb..49dd56224 100644 --- a/src/designer/src/lib/extension/qextensionmanager.h +++ b/src/designer/src/lib/extension/qextensionmanager.h @@ -51,7 +51,7 @@ public: QObject *extension(QObject *object, const QString &iid) const override; private: - typedef QList FactoryList; + using FactoryList = QList; typedef QHash FactoryMap; FactoryMap m_extensions; FactoryList m_globalExtension; diff --git a/src/designer/src/lib/sdk/abstractintegration.cpp b/src/designer/src/lib/sdk/abstractintegration.cpp index 84b3a67e2..ce37e8a4b 100644 --- a/src/designer/src/lib/sdk/abstractintegration.cpp +++ b/src/designer/src/lib/sdk/abstractintegration.cpp @@ -332,8 +332,6 @@ QDesignerIntegrationPrivate::QDesignerIntegrationPrivate(QDesignerIntegration *q void QDesignerIntegrationPrivate::initialize() { - typedef void (QDesignerIntegration::*QDesignerIntegrationUpdatePropertySlot3)(const QString &, const QVariant &, bool); - // // integrate the `Form Editor component' // @@ -342,7 +340,7 @@ void QDesignerIntegrationPrivate::initialize() QDesignerFormEditorInterface *core = q->core(); if (QDesignerPropertyEditor *designerPropertyEditor= qobject_cast(core->propertyEditor())) { QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::propertyValueChanged, - q, static_cast(&QDesignerIntegration::updateProperty)); + q, QOverload::of(&QDesignerIntegration::updateProperty)); QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::resetProperty, q, &QDesignerIntegration::resetProperty); QObject::connect(designerPropertyEditor, &QDesignerPropertyEditor::addDynamicProperty, diff --git a/src/designer/src/lib/sdk/abstractpromotioninterface.h b/src/designer/src/lib/sdk/abstractpromotioninterface.h index 41cb2281c..94c863116 100644 --- a/src/designer/src/lib/sdk/abstractpromotioninterface.h +++ b/src/designer/src/lib/sdk/abstractpromotioninterface.h @@ -49,7 +49,7 @@ public: QDesignerWidgetDataBaseItemInterface *promotedItem; }; - typedef QList PromotedClasses; + using PromotedClasses = QList; virtual PromotedClasses promotedClasses() const = 0; diff --git a/src/designer/src/lib/sdk/abstractwidgetbox.h b/src/designer/src/lib/sdk/abstractwidgetbox.h index 2b1b42bca..7d7600e5b 100644 --- a/src/designer/src/lib/sdk/abstractwidgetbox.h +++ b/src/designer/src/lib/sdk/abstractwidgetbox.h @@ -71,8 +71,6 @@ public: QSharedDataPointer m_data; }; - typedef QList WidgetList; - class Category { public: enum Type { Default, Scratchpad }; @@ -96,7 +94,7 @@ public: Type m_type; QList m_widget_list; }; - typedef QList CategoryList; + using CategoryList = QList; explicit QDesignerWidgetBoxInterface(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~QDesignerWidgetBoxInterface(); diff --git a/src/designer/src/lib/shared/actioneditor_p.h b/src/designer/src/lib/shared/actioneditor_p.h index 39705b256..321dbfb32 100644 --- a/src/designer/src/lib/shared/actioneditor_p.h +++ b/src/designer/src/lib/shared/actioneditor_p.h @@ -122,7 +122,7 @@ signals: void contextMenuRequested(QMenu *menu, QAction *item); private: - typedef QList ActionList; + using ActionList = QList; void deleteActions(QDesignerFormWindowInterface *formWindow, const ActionList &); #if QT_CONFIG(clipboard) void copyActions(QDesignerFormWindowInterface *formWindow, const ActionList &); diff --git a/src/designer/src/lib/shared/actionrepository_p.h b/src/designer/src/lib/shared/actionrepository_p.h index 5f13d786e..a68b3371f 100644 --- a/src/designer/src/lib/shared/actionrepository_p.h +++ b/src/designer/src/lib/shared/actionrepository_p.h @@ -98,7 +98,7 @@ signals: void resourceImageDropped(const QString &path, QAction *action); private: - typedef QList QStandardItemList; + using QStandardItemList = QList; void initializeHeaders(); static void setItems(QDesignerFormEditorInterface *core, QAction *a, @@ -203,7 +203,7 @@ public: QAction *currentAction() const; void setCurrentIndex(const QModelIndex &index); - typedef QList ActionList; + using ActionList = QList; ActionList selectedActions() const; QItemSelection selection() const; @@ -232,7 +232,7 @@ class QDESIGNER_SHARED_EXPORT ActionRepositoryMimeData: public QMimeData { Q_OBJECT public: - typedef QList ActionList; + using ActionList = QList; ActionRepositoryMimeData(const ActionList &, Qt::DropAction dropAction); ActionRepositoryMimeData(QAction *, Qt::DropAction dropAction); diff --git a/src/designer/src/lib/shared/connectionedit_p.h b/src/designer/src/lib/shared/connectionedit_p.h index c17057d27..6fd623457 100644 --- a/src/designer/src/lib/shared/connectionedit_p.h +++ b/src/designer/src/lib/shared/connectionedit_p.h @@ -67,15 +67,15 @@ class ConnectionEdit; class QDESIGNER_SHARED_EXPORT CETypes { public: - typedef QList ConnectionList; - typedef QHash ConnectionSet; - typedef QHash WidgetSet; + using ConnectionList = QList; + using ConnectionSet = QHash ; + using WidgetSet = QHash; class EndPoint { public: enum Type { Source, Target }; explicit EndPoint(Connection *_con = nullptr, Type _type = Source) : con(_con), type(_type) {} - bool isNull() const { return con == 0; } + bool isNull() const { return con == nullptr; } bool operator == (const EndPoint &other) const { return con == other.con && type == other.type; } bool operator != (const EndPoint &other) const { return !operator == (other); } Connection *con; diff --git a/src/designer/src/lib/shared/formlayoutmenu.cpp b/src/designer/src/lib/shared/formlayoutmenu.cpp index cab6bc1cb..c6bc492ab 100644 --- a/src/designer/src/lib/shared/formlayoutmenu.cpp +++ b/src/designer/src/lib/shared/formlayoutmenu.cpp @@ -131,8 +131,6 @@ FormLayoutRowDialog::FormLayoutRowDialog(QDesignerFormEditorInterface *core, m_fieldNameEdited(false), m_buddyClicked(false) { - typedef void (QComboBox::*QComboIntSignal)(int); - Q_ASSERT(m_buddyMarkerRegexp.isValid()); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); @@ -155,7 +153,8 @@ FormLayoutRowDialog::FormLayoutRowDialog(QDesignerFormEditorInterface *core, m_ui.fieldClassComboBox->addItems(fieldWidgetClasses(core)); m_ui.fieldClassComboBox->setCurrentIndex(0); - connect(m_ui.fieldClassComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui.fieldClassComboBox, + QOverload::of(&QComboBox::currentIndexChanged), this, &FormLayoutRowDialog::fieldClassChanged); updateOkButton(); diff --git a/src/designer/src/lib/shared/formlayoutmenu_p.h b/src/designer/src/lib/shared/formlayoutmenu_p.h index e5a197fe0..d4b56ac96 100644 --- a/src/designer/src/lib/shared/formlayoutmenu_p.h +++ b/src/designer/src/lib/shared/formlayoutmenu_p.h @@ -61,7 +61,7 @@ class QDESIGNER_SHARED_EXPORT FormLayoutMenu : public QObject Q_DISABLE_COPY_MOVE(FormLayoutMenu) Q_OBJECT public: - typedef QList ActionList; + using ActionList = QList; explicit FormLayoutMenu(QObject *parent); diff --git a/src/designer/src/lib/shared/formwindowbase.cpp b/src/designer/src/lib/shared/formwindowbase.cpp index 73a468b2b..82d8cba60 100644 --- a/src/designer/src/lib/shared/formwindowbase.cpp +++ b/src/designer/src/lib/shared/formwindowbase.cpp @@ -462,7 +462,7 @@ void FormWindowBase::deleteWidgetList(const QWidgetList &widget_list) QMenu *FormWindowBase::createExtensionTaskMenu(QDesignerFormWindowInterface *fw, QObject *o, bool trailingSeparator) { - typedef QList ActionList; + using ActionList = QList; ActionList actions; // 1) Standard public extension QExtensionManager *em = fw->core()->extensionManager(); diff --git a/src/designer/src/lib/shared/grid.cpp b/src/designer/src/lib/shared/grid.cpp index 5f5f8ea27..d1298d1f0 100644 --- a/src/designer/src/lib/shared/grid.cpp +++ b/src/designer/src/lib/shared/grid.cpp @@ -125,7 +125,7 @@ void Grid::paint(QPainter &p, const QWidget *widget, QPaintEvent *e) const const int xend = e->rect().right(); const int yend = e->rect().bottom(); - typedef QVector Points; + using Points = QVector; static Points points; points.clear(); diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp index 1a5b71d4a..436d5223b 100644 --- a/src/designer/src/lib/shared/layout.cpp +++ b/src/designer/src/lib/shared/layout.cpp @@ -931,7 +931,7 @@ void Grid::shrink() bool Grid::shrinkFormLayoutSpans() { bool shrunk = false; - typedef QSet WidgetSet; + using WidgetSet = QSet; // Determine unique set of widgets WidgetSet widgets; QWidget **end = m_cells + m_ncols * m_nrows; diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp index 5df701e98..ee09dfafd 100644 --- a/src/designer/src/lib/shared/morphmenu.cpp +++ b/src/designer/src/lib/shared/morphmenu.cpp @@ -226,7 +226,7 @@ static QString suggestObjectName(const QString &oldClassName, const QString &new // Find the label whose buddy the widget is. QLabel *buddyLabelOf(QDesignerFormWindowInterface *fw, QWidget *w) { - typedef QList LabelList; + using LabelList = QList; const LabelList labelList = fw->findChildren(); if (labelList.empty()) return nullptr; diff --git a/src/designer/src/lib/shared/morphmenu_p.h b/src/designer/src/lib/shared/morphmenu_p.h index 65c533280..eba1bdf3a 100644 --- a/src/designer/src/lib/shared/morphmenu_p.h +++ b/src/designer/src/lib/shared/morphmenu_p.h @@ -55,7 +55,7 @@ class QDESIGNER_SHARED_EXPORT MorphMenu : public QObject { Q_DISABLE_COPY_MOVE(MorphMenu) Q_OBJECT public: - typedef QList ActionList; + using ActionList = QList; explicit MorphMenu(QObject *parent = nullptr); diff --git a/src/designer/src/lib/shared/newformwidget.cpp b/src/designer/src/lib/shared/newformwidget.cpp index 4845e5945..b3853ae21 100644 --- a/src/designer/src/lib/shared/newformwidget.cpp +++ b/src/designer/src/lib/shared/newformwidget.cpp @@ -129,8 +129,7 @@ NewFormWidget::NewFormWidget(QDesignerFormEditorInterface *core, QWidget *parent m_currentItem(nullptr), m_acceptedItem(nullptr) { - typedef void (QComboBox::*QComboIntSignal)(int); - typedef QList DeviceProfileList; + using DeviceProfileList = QList; m_ui->setupUi(this); m_ui->treeWidget->setItemDelegate(new qdesigner_internal::SheetDelegate(m_ui->treeWidget, this)); @@ -181,7 +180,8 @@ NewFormWidget::NewFormWidget(QDesignerFormEditorInterface *core, QWidget *parent // Fill profile combo m_deviceProfiles = settings.deviceProfiles(); m_ui->profileComboBox->addItem(tr("None")); - connect(m_ui->profileComboBox, static_cast(&QComboBox::currentIndexChanged), + connect(m_ui->profileComboBox, + QOverload::of(&QComboBox::currentIndexChanged), this, &NewFormWidget::slotDeviceProfileIndexChanged); if (m_deviceProfiles.empty()) { m_ui->profileComboBox->setEnabled(false); diff --git a/src/designer/src/lib/shared/newformwidget_p.h b/src/designer/src/lib/shared/newformwidget_p.h index 0a53f4768..2f28ed6be 100644 --- a/src/designer/src/lib/shared/newformwidget_p.h +++ b/src/designer/src/lib/shared/newformwidget_p.h @@ -71,7 +71,7 @@ class QDESIGNER_SHARED_EXPORT NewFormWidget : public QDesignerNewFormWidgetInter Q_DISABLE_COPY_MOVE(NewFormWidget) public: - typedef QList DeviceProfileList; + using DeviceProfileList = QList; explicit NewFormWidget(QDesignerFormEditorInterface *core, QWidget *parentWidget); ~NewFormWidget() override; @@ -112,8 +112,8 @@ private: bool showCurrentItemPixmap(); // Pixmap cache (item, profile combo index) - typedef QPair ItemPixmapCacheKey; - typedef QMap ItemPixmapCache; + using ItemPixmapCacheKey = QPair; + using ItemPixmapCache = QMap; ItemPixmapCache m_itemPixmapCache; QDesignerFormEditorInterface *m_core; diff --git a/src/designer/src/lib/shared/pluginmanager.cpp b/src/designer/src/lib/shared/pluginmanager.cpp index 7e2408ad6..ddc8cd611 100644 --- a/src/designer/src/lib/shared/pluginmanager.cpp +++ b/src/designer/src/lib/shared/pluginmanager.cpp @@ -134,9 +134,9 @@ static inline QString getDesignerLanguage(QDesignerFormEditorInterface *core) class QDesignerCustomWidgetSharedData : public QSharedData { public: // Type of a string property - typedef QPair StringPropertyType; - typedef QHash StringPropertyTypeMap; - typedef QHash PropertyToolTipMap; + using StringPropertyType = QPair; + using StringPropertyTypeMap = QHash; + using PropertyToolTipMap = QHash; explicit QDesignerCustomWidgetSharedData(const QString &thePluginPath) : pluginPath(thePluginPath) {} void clearXML(); @@ -453,7 +453,7 @@ QDesignerCustomWidgetData::ParseResult class QDesignerPluginManagerPrivate { public: - typedef QPair ClassNamePropertyNameKey; + using ClassNamePropertyNameKey = QPair; QDesignerPluginManagerPrivate(QDesignerFormEditorInterface *core); diff --git a/src/designer/src/lib/shared/pluginmanager_p.h b/src/designer/src/lib/shared/pluginmanager_p.h index 249748e93..373d0fe51 100644 --- a/src/designer/src/lib/shared/pluginmanager_p.h +++ b/src/designer/src/lib/shared/pluginmanager_p.h @@ -99,7 +99,7 @@ class QDESIGNER_SHARED_EXPORT QDesignerPluginManager: public QObject { Q_OBJECT public: - typedef QList CustomWidgetList; + using CustomWidgetList = QList; explicit QDesignerPluginManager(QDesignerFormEditorInterface *core); ~QDesignerPluginManager() override; diff --git a/src/designer/src/lib/shared/previewconfigurationwidget.cpp b/src/designer/src/lib/shared/previewconfigurationwidget.cpp index 6352468c3..f9ddb4b5e 100644 --- a/src/designer/src/lib/shared/previewconfigurationwidget.cpp +++ b/src/designer/src/lib/shared/previewconfigurationwidget.cpp @@ -57,7 +57,7 @@ static const char *skinExtensionC = "skin"; // Pair of skin name, path typedef QPair SkinNamePath; -typedef QList Skins; +using Skins = QList; enum { SkinComboNoneIndex = 0 }; // find default skins (resources) @@ -314,13 +314,11 @@ PreviewConfigurationWidget::PreviewConfigurationWidget(QDesignerFormEditorInterf QGroupBox(parent), m_impl(new PreviewConfigurationWidgetPrivate(core, this)) { - typedef void (QComboBox::*QComboIntSignal)(int); - connect(m_impl->appStyleSheetChangeButton(), &QAbstractButton::clicked, this, &PreviewConfigurationWidget::slotEditAppStyleSheet); connect(m_impl->skinRemoveButton(), &QAbstractButton::clicked, this, &PreviewConfigurationWidget::slotDeleteSkinEntry); - connect(m_impl->skinCombo(), static_cast(&QComboBox::currentIndexChanged), + connect(m_impl->skinCombo(), QOverload::of(&QComboBox::currentIndexChanged), this, &PreviewConfigurationWidget::slotSkinChanged); m_impl->retrieveSettings(); diff --git a/src/designer/src/lib/shared/previewmanager.cpp b/src/designer/src/lib/shared/previewmanager.cpp index c4a3ddd92..1adfc727b 100644 --- a/src/designer/src/lib/shared/previewmanager.cpp +++ b/src/designer/src/lib/shared/previewmanager.cpp @@ -555,7 +555,7 @@ public: QPointer m_activePreview; - typedef QList PreviewDataList; + using PreviewDataList = QList; PreviewDataList m_previews; @@ -798,7 +798,7 @@ QWidget *PreviewManager::showPreview(const QDesignerFormWindowInterface *fw, QWidget *PreviewManager::raise(const QDesignerFormWindowInterface *fw, const PreviewConfiguration &pc) { - typedef PreviewManagerPrivate::PreviewDataList PreviewDataList; + using PreviewDataList = PreviewManagerPrivate::PreviewDataList; if (d->m_previews.empty()) return nullptr; @@ -832,7 +832,7 @@ void PreviewManager::closeAllPreviews() void PreviewManager::updatePreviewClosed(QWidget *w) { - typedef PreviewManagerPrivate::PreviewDataList PreviewDataList; + using PreviewDataList = PreviewManagerPrivate::PreviewDataList; if (d->m_updateBlocked) return; // Purge out all 0 or widgets to be deleted diff --git a/src/designer/src/lib/shared/promotionmodel.cpp b/src/designer/src/lib/shared/promotionmodel.cpp index 63273c3a7..c2dd25523 100644 --- a/src/designer/src/lib/shared/promotionmodel.cpp +++ b/src/designer/src/lib/shared/promotionmodel.cpp @@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE namespace { - typedef QList StandardItemList; + using StandardItemList = QList; // Model columns. enum { ClassNameColumn, IncludeFileColumn, IncludeTypeColumn, ReferencedColumn, NumColumns }; @@ -120,7 +120,7 @@ namespace qdesigner_internal { } void PromotionModel::updateFromWidgetDatabase() { - typedef QDesignerPromotionInterface::PromotedClasses PromotedClasses; + using PromotedClasses = QDesignerPromotionInterface::PromotedClasses; clear(); initializeHeaders(); diff --git a/src/designer/src/lib/shared/promotiontaskmenu_p.h b/src/designer/src/lib/shared/promotiontaskmenu_p.h index bb382ac1d..830986968 100644 --- a/src/designer/src/lib/shared/promotiontaskmenu_p.h +++ b/src/designer/src/lib/shared/promotiontaskmenu_p.h @@ -82,7 +82,7 @@ public: // Defaults to "Demote to %1".arg(class). void setDemoteLabel(const QString &demoteLabel); - typedef QList ActionList; + using ActionList = QList; enum AddFlags { LeadingSeparator = 1, TrailingSeparator = 2, SuppressGlobalEdit = 4}; @@ -111,7 +111,7 @@ private: PromotionState createPromotionActions(QDesignerFormWindowInterface *formWindow); QDesignerFormWindowInterface *formWindow() const; - typedef QList > PromotionSelectionList; + using PromotionSelectionList = QList >; PromotionSelectionList promotionSelectionList(QDesignerFormWindowInterface *formWindow) const; Mode m_mode; diff --git a/src/designer/src/lib/shared/qdesigner_command.cpp b/src/designer/src/lib/shared/qdesigner_command.cpp index ed8bde3de..7346b98f3 100644 --- a/src/designer/src/lib/shared/qdesigner_command.cpp +++ b/src/designer/src/lib/shared/qdesigner_command.cpp @@ -232,7 +232,7 @@ void InsertWidgetCommand::undo() void InsertWidgetCommand::refreshBuddyLabels() { - typedef QList LabelList; + using LabelList = QList; const LabelList label_list = formWindow()->findChildren(); if (label_list.empty()) @@ -620,7 +620,7 @@ PromoteToCustomWidgetCommand::PromoteToCustomWidgetCommand { } -void PromoteToCustomWidgetCommand::init(const WidgetList &widgets,const QString &customClassName) +void PromoteToCustomWidgetCommand::init(const WidgetPointerList &widgets,const QString &customClassName) { m_widgets = widgets; m_customClassName = customClassName; diff --git a/src/designer/src/lib/shared/qdesigner_command_p.h b/src/designer/src/lib/shared/qdesigner_command_p.h index abb04368d..f967c22f8 100644 --- a/src/designer/src/lib/shared/qdesigner_command_p.h +++ b/src/designer/src/lib/shared/qdesigner_command_p.h @@ -179,7 +179,7 @@ private: // Helper to correctly unmanage a widget and its children for delete operations class QDESIGNER_SHARED_EXPORT ManageWidgetCommandHelper { public: - typedef QVector WidgetVector; + using WidgetVector = QVector; ManageWidgetCommandHelper(); void init(const QDesignerFormWindowInterface *fw, QWidget *widget); @@ -316,24 +316,24 @@ private: class QDESIGNER_SHARED_EXPORT PromoteToCustomWidgetCommand : public QDesignerFormWindowCommand { public: - typedef QList > WidgetList; + using WidgetPointerList = QList >; explicit PromoteToCustomWidgetCommand(QDesignerFormWindowInterface *formWindow); - void init(const WidgetList &widgets, const QString &customClassName); + void init(const WidgetPointerList &widgets, const QString &customClassName); void redo() override; void undo() override; private: void updateSelection(); - WidgetList m_widgets; + WidgetPointerList m_widgets; QString m_customClassName; }; class QDESIGNER_SHARED_EXPORT DemoteFromCustomWidgetCommand : public QDesignerFormWindowCommand { public: - typedef PromoteToCustomWidgetCommand::WidgetList WidgetList; + using WidgetList = PromoteToCustomWidgetCommand::WidgetPointerList; explicit DemoteFromCustomWidgetCommand(QDesignerFormWindowInterface *formWindow); @@ -354,7 +354,7 @@ public: void restore(QDesignerFormWindowInterface *formWindow) const; private: - typedef QList > WidgetPointerList; + using WidgetPointerList = QList >; WidgetPointerList m_selection; QPointer m_current; }; @@ -878,8 +878,8 @@ struct QDESIGNER_SHARED_EXPORT ListContents { // methods to retrieve and apply for ChangeTableContentsCommand struct QDESIGNER_SHARED_EXPORT TableWidgetContents { - typedef QPair CellRowColumnAddress; - typedef QMap TableItemMap; + using CellRowColumnAddress = QPair; + using TableItemMap = QMap; TableWidgetContents(); void clear(); @@ -1016,7 +1016,7 @@ public: QAction *before; QWidget *widget; }; - typedef QList ActionData; + using ActionData = QList; private: QAction *m_action; diff --git a/src/designer/src/lib/shared/qdesigner_dnditem_p.h b/src/designer/src/lib/shared/qdesigner_dnditem_p.h index 917a37159..36419389b 100644 --- a/src/designer/src/lib/shared/qdesigner_dnditem_p.h +++ b/src/designer/src/lib/shared/qdesigner_dnditem_p.h @@ -91,7 +91,7 @@ class QDESIGNER_SHARED_EXPORT QDesignerMimeData : public QMimeData { Q_OBJECT public: - typedef QList QDesignerDnDItems; + using QDesignerDnDItems = QList; ~QDesignerMimeData() override; diff --git a/src/designer/src/lib/shared/qdesigner_formbuilder_p.h b/src/designer/src/lib/shared/qdesigner_formbuilder_p.h index e70bfd507..ceaf1b395 100644 --- a/src/designer/src/lib/shared/qdesigner_formbuilder_p.h +++ b/src/designer/src/lib/shared/qdesigner_formbuilder_p.h @@ -122,7 +122,7 @@ protected: private: QDesignerFormEditorInterface *m_core; - typedef QSet WidgetSet; + using WidgetSet = QSet; WidgetSet m_customWidgetsWithScript; const DeviceProfile m_deviceProfile; diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp index a469dd520..7c44ec4f7 100644 --- a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp @@ -100,7 +100,7 @@ void QDesignerFormWindowCommand::updateBuddies(QDesignerFormWindowInterface *for { QExtensionManager* extensionManager = form->core()->extensionManager(); - typedef QList LabelList; + using LabelList = QList; const LabelList label_list = form->findChildren(); if (label_list.empty()) diff --git a/src/designer/src/lib/shared/qdesigner_introspection.cpp b/src/designer/src/lib/shared/qdesigner_introspection.cpp index a2dfd037f..3001d6b76 100644 --- a/src/designer/src/lib/shared/qdesigner_introspection.cpp +++ b/src/designer/src/lib/shared/qdesigner_introspection.cpp @@ -283,13 +283,13 @@ namespace { const qdesigner_internal::QDesignerIntrospection *m_introspection; const QMetaObject *m_metaObject; - typedef QVector Enumerators; + using Enumerators = QVector; Enumerators m_enumerators; - typedef QVector Methods; + using Methods = QVector; Methods m_methods; - typedef QVector Properties; + using Properties = QVector; Properties m_properties; QDesignerMetaPropertyInterface *m_userProperty; diff --git a/src/designer/src/lib/shared/qdesigner_introspection_p.h b/src/designer/src/lib/shared/qdesigner_introspection_p.h index 3fec4bc47..6c4d37e4d 100644 --- a/src/designer/src/lib/shared/qdesigner_introspection_p.h +++ b/src/designer/src/lib/shared/qdesigner_introspection_p.h @@ -60,7 +60,7 @@ namespace qdesigner_internal { const QDesignerMetaObjectInterface* metaObjectForQMetaObject(const QMetaObject *metaObject) const; private: - typedef QMap MetaObjectMap; + using MetaObjectMap = QMap; mutable MetaObjectMap m_metaObjectMap; }; diff --git a/src/designer/src/lib/shared/qdesigner_membersheet.cpp b/src/designer/src/lib/shared/qdesigner_membersheet.cpp index 8f54ac451..93371ac06 100644 --- a/src/designer/src/lib/shared/qdesigner_membersheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_membersheet.cpp @@ -73,7 +73,7 @@ public: bool visible{true}; }; - typedef QHash InfoHash; + using InfoHash = QHash; Info &ensureInfo(int index); @@ -158,8 +158,7 @@ QString QDesignerMemberSheet::signature(int index) const bool QDesignerMemberSheet::isVisible(int index) const { - typedef QDesignerMemberSheetPrivate::InfoHash InfoHash; - const InfoHash::const_iterator it = d->m_info.constFind(index); + const auto it = d->m_info.constFind(index); if (it != d->m_info.constEnd()) return it.value().visible; diff --git a/src/designer/src/lib/shared/qdesigner_menubar.cpp b/src/designer/src/lib/shared/qdesigner_menubar.cpp index d3aa2a717..e212eff82 100644 --- a/src/designer/src/lib/shared/qdesigner_menubar.cpp +++ b/src/designer/src/lib/shared/qdesigner_menubar.cpp @@ -56,7 +56,7 @@ Q_DECLARE_METATYPE(QAction*) QT_BEGIN_NAMESPACE -typedef QList ActionList; +using ActionList = QList; using namespace qdesigner_internal; diff --git a/src/designer/src/lib/shared/qdesigner_promotion.cpp b/src/designer/src/lib/shared/qdesigner_promotion.cpp index d0403866e..2d8169960 100644 --- a/src/designer/src/lib/shared/qdesigner_promotion.cpp +++ b/src/designer/src/lib/shared/qdesigner_promotion.cpp @@ -166,7 +166,7 @@ namespace qdesigner_internal { QList QDesignerPromotion::promotionBaseClasses() const { - typedef QMap SortedDatabaseItemMap; + using SortedDatabaseItemMap = QMap; SortedDatabaseItemMap sortedDatabaseItemMap; QDesignerWidgetDataBaseInterface *widgetDataBase = m_core->widgetDataBase(); @@ -202,9 +202,9 @@ namespace qdesigner_internal { QDesignerPromotion::PromotedClasses QDesignerPromotion::promotedClasses() const { - typedef QMap ClassNameItemMap; + using ClassNameItemMap = QMap; // A map containing base classes and their promoted classes. - typedef QMap BaseClassPromotedMap; + using BaseClassPromotedMap = QMap; BaseClassPromotedMap baseClassPromotedMap; diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp index 1467efbe3..7058b0c81 100644 --- a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp +++ b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp @@ -288,7 +288,7 @@ namespace qdesigner_internal { } const QStringList &QDesignerPromotionDialog::baseClassNames(const QDesignerPromotionInterface *promotion) { - typedef QList WidgetDataBaseItemList; + using WidgetDataBaseItemList = QList; static QStringList rc; if (rc.empty()) { // Convert the item list into a string list. diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp index 9f4eec9ce..0e6287137 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp @@ -1004,7 +1004,7 @@ PropertyHelper *PropertyListCommand::createPropertyHelper(QObject *object, Speci } // Init from a list and make sure referenceObject is added first to obtain the right property group -bool PropertyListCommand::initList(const ObjectList &list, const QString &apropertyName, QObject *referenceObject) +bool PropertyListCommand::initList(const QObjectList &list, const QString &apropertyName, QObject *referenceObject) { propertyHelperList().clear(); @@ -1209,7 +1209,7 @@ bool SetPropertyCommand::init(QObject *object, const QString &apropertyName, con return true; } -bool SetPropertyCommand::init(const ObjectList &list, const QString &apropertyName, const QVariant &newValue, +bool SetPropertyCommand::init(const QObjectList &list, const QString &apropertyName, const QVariant &newValue, QObject *referenceObject, bool enableSubPropertyHandling) { if (!initList(list, apropertyName, referenceObject)) @@ -1319,10 +1319,10 @@ bool ResetPropertyCommand::init(QObject *object, const QString &apropertyName) return true; } -bool ResetPropertyCommand::init(const ObjectList &list, const QString &apropertyName, QObject *referenceObject) +bool ResetPropertyCommand::init(const QObjectList &list, const QString &apropertyName, QObject *referenceObject) { - ObjectList modifiedList = list; // filter out modified properties - for (ObjectList::iterator it = modifiedList.begin(); it != modifiedList.end() ; ) { + QObjectList modifiedList = list; // filter out modified properties + for (auto it = modifiedList.begin(); it != modifiedList.end() ; ) { QDesignerPropertySheetExtension* sheet = propertySheet(*it); Q_ASSERT(sheet); const int index = sheet->indexOf(apropertyName); diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand_p.h b/src/designer/src/lib/shared/qdesigner_propertycommand_p.h index 78ed73181..f1e43617a 100644 --- a/src/designer/src/lib/shared/qdesigner_propertycommand_p.h +++ b/src/designer/src/lib/shared/qdesigner_propertycommand_p.h @@ -72,7 +72,7 @@ class QDESIGNER_SHARED_EXPORT PropertyHelper { Q_DISABLE_COPY(PropertyHelper) public: // A pair of Value and changed flag - typedef QPair Value; + using Value = QPair; enum ObjectType {OT_Object, OT_FreeAction, OT_AssociatedAction, OT_Widget}; @@ -135,8 +135,6 @@ private: class QDESIGNER_SHARED_EXPORT PropertyListCommand : public QDesignerFormWindowCommand { public: - typedef QList ObjectList; - explicit PropertyListCommand(QDesignerFormWindowInterface *formWindow, QUndoCommand *parent = nullptr); QObject* object(int index = 0) const; @@ -149,14 +147,14 @@ public: virtual void undo(); protected: - typedef QSharedPointer PropertyHelperPtr; - typedef QList PropertyHelperList; + using PropertyHelperPtr = QSharedPointer; + using PropertyHelperList = QList; // add an object bool add(QObject *object, const QString &propertyName); // Init from a list and make sure referenceObject is added first to obtain the right property group - bool initList(const ObjectList &list, const QString &apropertyName, QObject *referenceObject = nullptr); + bool initList(const QObjectList &list, const QString &apropertyName, QObject *referenceObject = nullptr); // set a new value, return update mask unsigned setValue(QVariant value, bool changed, unsigned subPropertyMask); @@ -207,12 +205,10 @@ class QDESIGNER_SHARED_EXPORT SetPropertyCommand: public PropertyListCommand { public: - typedef QList ObjectList; - explicit SetPropertyCommand(QDesignerFormWindowInterface *formWindow, QUndoCommand *parent = nullptr); bool init(QObject *object, const QString &propertyName, const QVariant &newValue); - bool init(const ObjectList &list, const QString &propertyName, const QVariant &newValue, + bool init(const QObjectList &list, const QString &propertyName, const QVariant &newValue, QObject *referenceObject = nullptr, bool enableSubPropertyHandling = true); @@ -241,12 +237,10 @@ class QDESIGNER_SHARED_EXPORT ResetPropertyCommand: public PropertyListCommand { public: - typedef QList ObjectList; - explicit ResetPropertyCommand(QDesignerFormWindowInterface *formWindow); bool init(QObject *object, const QString &propertyName); - bool init(const ObjectList &list, const QString &propertyName, QObject *referenceObject = nullptr); + bool init(const QObjectList &list, const QString &propertyName, QObject *referenceObject = nullptr); virtual void redo(); diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp index c226ebae0..3a26553fd 100644 --- a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp @@ -41,9 +41,9 @@ QT_BEGIN_NAMESPACE namespace qdesigner_internal { -typedef QDesignerPropertyEditor::StringPropertyParameters StringPropertyParameters; +using StringPropertyParameters = QDesignerPropertyEditor::StringPropertyParameters; // A map of property name to type -typedef QHash PropertyNameTypeMap; +using PropertyNameTypeMap = QHash; // Compile a map of hard-coded string property types static const PropertyNameTypeMap &stringPropertyTypes() diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h b/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h index 2cdd1fc8f..dbb116f65 100644 --- a/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h +++ b/src/designer/src/lib/shared/qdesigner_propertyeditor_p.h @@ -59,7 +59,7 @@ public: explicit QDesignerPropertyEditor(QWidget *parent = nullptr, Qt::WindowFlags flags = nullptr); // A pair . - typedef QPair StringPropertyParameters; + using StringPropertyParameters = QPair; // Return a pair of validation mode and flag indicating whether property is translatable // for textual properties. diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp index a60f183df..fbb0746aa 100644 --- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp +++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp @@ -127,8 +127,8 @@ static bool hasLayoutAttributes(QDesignerFormEditorInterface *core, QObject *obj // Cache DesignerMetaEnum by scope/name of a QMetaEnum static const qdesigner_internal::DesignerMetaEnum &designerMetaEnumFor(const QDesignerMetaEnumInterface *me) { - typedef QPair ScopeNameKey; - typedef QMap DesignerMetaEnumCache; + using ScopeNameKey = QPair; + using DesignerMetaEnumCache = QMap; static DesignerMetaEnumCache cache; const QString name = me->name(); @@ -149,8 +149,8 @@ static const qdesigner_internal::DesignerMetaEnum &designerMetaEnumFor(const QDe // Cache DesignerMetaFlags by scope/name of a QMetaEnum static const qdesigner_internal::DesignerMetaFlags &designerMetaFlagsFor(const QDesignerMetaEnumInterface *me) { - typedef QPair ScopeNameKey; - typedef QMap DesignerMetaFlagsCache; + using ScopeNameKey = QPair; + using DesignerMetaFlagsCache = QMap; static DesignerMetaFlagsCache cache; const QString name = me->name(); @@ -171,8 +171,8 @@ static const qdesigner_internal::DesignerMetaFlags &designerMetaFlagsFor(const Q // ------------ QDesignerMemberSheetPrivate class QDesignerPropertySheetPrivate { public: - typedef QDesignerPropertySheet::PropertyType PropertyType; - typedef QDesignerPropertySheet::ObjectType ObjectType; + using PropertyType = QDesignerPropertySheet::PropertyType; + using ObjectType = QDesignerPropertySheet::ObjectType; explicit QDesignerPropertySheetPrivate(QDesignerPropertySheet *sheetPublic, QObject *object, QObject *sheetParent); @@ -228,7 +228,7 @@ public: const QDesignerMetaObjectInterface *m_meta; const ObjectType m_objectType; - typedef QHash InfoHash; + using InfoHash = QHash; InfoHash m_info; QHash m_fakeProperties; QHash m_addProperties; @@ -468,7 +468,7 @@ QDesignerPropertySheet::PropertyType QDesignerPropertySheetPrivate::propertyType QString QDesignerPropertySheetPrivate::transformLayoutPropertyName(int index) const { - typedef QMap TypeNameMap; + using TypeNameMap = QMap; static TypeNameMap typeNameMap; if (typeNameMap.empty()) { typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutObjectName, QStringLiteral("objectName")); @@ -560,7 +560,7 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) QObject(parent), d(new QDesignerPropertySheetPrivate(this, object, parent)) { - typedef QDesignerPropertySheetPrivate::Info Info; + using Info = QDesignerPropertySheetPrivate::Info; const QDesignerMetaObjectInterface *baseMeta = d->m_meta; while (baseMeta &&baseMeta->className().startsWith(QStringLiteral("QDesigner"))) { @@ -674,7 +674,7 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent) createFakeProperty(QStringLiteral("floating")); } - typedef QList ByteArrayList; + using ByteArrayList = QList; const ByteArrayList names = object->dynamicPropertyNames(); if (!names.empty()) { const ByteArrayList::const_iterator cend = names.constEnd(); @@ -722,7 +722,7 @@ bool QDesignerPropertySheet::canAddDynamicProperty(const QString &propName) cons int QDesignerPropertySheet::addDynamicProperty(const QString &propName, const QVariant &value) { - typedef QDesignerPropertySheetPrivate::Info Info; + using Info = QDesignerPropertySheetPrivate::Info; if (!value.isValid()) return -1; // property has invalid type if (!canAddDynamicProperty(propName)) @@ -883,7 +883,7 @@ void QDesignerPropertySheet::setIconCache(qdesigner_internal::DesignerIconCache int QDesignerPropertySheet::createFakeProperty(const QString &propertyName, const QVariant &value) { - typedef QDesignerPropertySheetPrivate::Info Info; + using Info = QDesignerPropertySheetPrivate::Info; // fake properties const int index = d->m_meta->indexOfProperty(propertyName); if (index != -1) { @@ -1612,7 +1612,7 @@ struct QDesignerAbstractPropertySheetFactory::PropertySheetFactoryPrivate { const QString m_propertySheetId; const QString m_dynamicPropertySheetId; - typedef QMap ExtensionMap; + using ExtensionMap = QMap; ExtensionMap m_extensions; }; diff --git a/src/designer/src/lib/shared/qdesigner_stackedbox_p.h b/src/designer/src/lib/shared/qdesigner_stackedbox_p.h index 851e3b294..36b876d78 100644 --- a/src/designer/src/lib/shared/qdesigner_stackedbox_p.h +++ b/src/designer/src/lib/shared/qdesigner_stackedbox_p.h @@ -144,7 +144,7 @@ private: QStackedWidget *m_stackedWidget; }; -typedef QDesignerPropertySheetFactory QStackedWidgetPropertySheetFactory; +using QStackedWidgetPropertySheetFactory = QDesignerPropertySheetFactory; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp index e8b744bb3..2f003cf6c 100644 --- a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp +++ b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp @@ -404,7 +404,7 @@ QTabWidgetPropertySheet::QTabWidgetPropertySheet(QTabWidget *object, QObject *pa QTabWidgetPropertySheet::TabWidgetProperty QTabWidgetPropertySheet::tabWidgetPropertyFromName(const QString &name) { - typedef QHash TabWidgetPropertyHash; + using TabWidgetPropertyHash = QHash; static TabWidgetPropertyHash tabWidgetPropertyHash; if (tabWidgetPropertyHash.empty()) { tabWidgetPropertyHash.insert(QLatin1String(currentTabTextKey), PropertyCurrentTabText); diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget_p.h b/src/designer/src/lib/shared/qdesigner_tabwidget_p.h index 8a13c13b8..1a488fe69 100644 --- a/src/designer/src/lib/shared/qdesigner_tabwidget_p.h +++ b/src/designer/src/lib/shared/qdesigner_tabwidget_p.h @@ -133,7 +133,7 @@ private: QMap m_pageToData; }; -typedef QDesignerPropertySheetFactory QTabWidgetPropertySheetFactory; +using QTabWidgetPropertySheetFactory = QDesignerPropertySheetFactory; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_taskmenu_p.h b/src/designer/src/lib/shared/qdesigner_taskmenu_p.h index c8e9bb58e..b4bc23da4 100644 --- a/src/designer/src/lib/shared/qdesigner_taskmenu_p.h +++ b/src/designer/src/lib/shared/qdesigner_taskmenu_p.h @@ -109,7 +109,7 @@ private: QDesignerTaskMenuPrivate *d; }; -typedef ExtensionFactory QDesignerTaskMenuFactory; +using QDesignerTaskMenuFactory = ExtensionFactory; } // namespace qdesigner_internal diff --git a/src/designer/src/lib/shared/qdesigner_toolbar.cpp b/src/designer/src/lib/shared/qdesigner_toolbar.cpp index 753be7b95..28c2ca285 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbar.cpp +++ b/src/designer/src/lib/shared/qdesigner_toolbar.cpp @@ -55,7 +55,7 @@ Q_DECLARE_METATYPE(QAction*) QT_BEGIN_NAMESPACE -typedef QList ActionList; +using ActionList = QList; namespace qdesigner_internal { // ------------------- ToolBarEventFilter diff --git a/src/designer/src/lib/shared/qdesigner_toolbox.cpp b/src/designer/src/lib/shared/qdesigner_toolbox.cpp index 434b22c55..f0c0dc726 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbox.cpp +++ b/src/designer/src/lib/shared/qdesigner_toolbox.cpp @@ -254,7 +254,7 @@ QToolBoxWidgetPropertySheet::QToolBoxWidgetPropertySheet(QToolBox *object, QObje QToolBoxWidgetPropertySheet::ToolBoxProperty QToolBoxWidgetPropertySheet::toolBoxPropertyFromName(const QString &name) { - typedef QHash ToolBoxPropertyHash; + using ToolBoxPropertyHash = QHash; static ToolBoxPropertyHash toolBoxPropertyHash; if (toolBoxPropertyHash.empty()) { toolBoxPropertyHash.insert(QLatin1String(currentItemTextKey), PropertyCurrentItemText); diff --git a/src/designer/src/lib/shared/qdesigner_toolbox_p.h b/src/designer/src/lib/shared/qdesigner_toolbox_p.h index 70dc68d9d..52a458afe 100644 --- a/src/designer/src/lib/shared/qdesigner_toolbox_p.h +++ b/src/designer/src/lib/shared/qdesigner_toolbox_p.h @@ -120,7 +120,7 @@ private: QMap m_pageToData; }; -typedef QDesignerPropertySheetFactory QToolBoxWidgetPropertySheetFactory; +using QToolBoxWidgetPropertySheetFactory = QDesignerPropertySheetFactory; QT_END_NAMESPACE diff --git a/src/designer/src/lib/shared/qdesigner_utils_p.h b/src/designer/src/lib/shared/qdesigner_utils_p.h index 12374296b..4013ded7d 100644 --- a/src/designer/src/lib/shared/qdesigner_utils_p.h +++ b/src/designer/src/lib/shared/qdesigner_utils_p.h @@ -81,10 +81,10 @@ template class MetaEnum { public: - typedef QMap KeyToValueMap; + using KeyToValueMap = QMap; MetaEnum(const QString &name, const QString &scope, const QString &separator); - MetaEnum() {} + MetaEnum() = default; void addKey(IntType value, const QString &name); QString valueToKey(IntType value, bool *ok = nullptr) const; @@ -273,8 +273,8 @@ class QDESIGNER_SHARED_EXPORT PropertySheetIconValue PropertySheetIconValue themed() const; PropertySheetIconValue unthemed() const; - typedef QPair ModeStateKey; - typedef QMap ModeStateToPixmapMap; + using ModeStateKey = QPair; + using ModeStateToPixmapMap = QMap; const ModeStateToPixmapMap &paths() const; diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp index 9b6911dcd..125eeb2b8 100644 --- a/src/designer/src/lib/shared/qlayout_widget.cpp +++ b/src/designer/src/lib/shared/qlayout_widget.cpp @@ -464,12 +464,12 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const void simplify(const QDesignerFormEditorInterface *, QWidget *, const QRect &) override {} // Helper for restoring layout states - typedef QVector LayoutItemVector; + using LayoutItemVector = QVector; static LayoutItemVector disassembleLayout(QLayout *lt); static QLayoutItem *findItemOfWidget(const LayoutItemVector &lv, QWidget *w); private: - typedef QVector BoxLayoutState; + using BoxLayoutState = QVector; static BoxLayoutState state(const QBoxLayout*lt); @@ -608,7 +608,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const }; // Horiontal, Vertical pair of state typedef QPair CellState; - typedef QVector CellStates; + using CellStates = QVector; // Figure out states of a cell and return as a flat vector of // [column1, column2,...] (address as row * columnCount + col) @@ -695,7 +695,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const void GridLayoutState::applyToLayout(const QDesignerFormEditorInterface *core, QWidget *w) const { - typedef QHash LayoutItemRectMap; + using LayoutItemRectMap =QHash; QGridLayout *grid = qobject_cast(LayoutInfo::managedLayout(core, w)); Q_ASSERT(grid); if (debugLayout) @@ -1015,7 +1015,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const class FormLayoutHelper : public LayoutHelper { public: typedef QPair WidgetPair; - typedef QVector FormLayoutState; + using FormLayoutState = QVector; FormLayoutHelper() {} @@ -1179,8 +1179,8 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const void FormLayoutHelper::simplify(const QDesignerFormEditorInterface *core, QWidget *widgetWithManagedLayout, const QRect &restrictionArea) { - typedef QPair LayoutItemPair; - typedef QVector LayoutItemPairs; + using LayoutItemPair = QPair; + using LayoutItemPairs = QVector; QFormLayout *formLayout = qobject_cast(LayoutInfo::managedLayout(core, widgetWithManagedLayout)); Q_ASSERT(formLayout); diff --git a/src/designer/src/lib/shared/qsimpleresource_p.h b/src/designer/src/lib/shared/qsimpleresource_p.h index c615f4ee2..be67a43dc 100644 --- a/src/designer/src/lib/shared/qsimpleresource_p.h +++ b/src/designer/src/lib/shared/qsimpleresource_p.h @@ -101,7 +101,7 @@ private: // Contents of clipboard for formbuilder copy and paste operations // (Actions and widgets) struct QDESIGNER_SHARED_EXPORT FormBuilderClipboard { - typedef QList ActionList; + using ActionList = QList; FormBuilderClipboard() {} FormBuilderClipboard(QWidget *w); diff --git a/src/designer/src/lib/shared/qtresourcemodel.cpp b/src/designer/src/lib/shared/qtresourcemodel.cpp index 86eda0190..1586fcf44 100644 --- a/src/designer/src/lib/shared/qtresourcemodel.cpp +++ b/src/designer/src/lib/shared/qtresourcemodel.cpp @@ -146,7 +146,7 @@ void QtResourceSet::setModified(const QString &path) // ------------------- QtResourceModelPrivate const QByteArray *QtResourceModelPrivate::createResource(const QString &path, QStringList *contents, int *errorCount, QIODevice &errorDevice) const { - typedef RCCResourceLibrary::ResourceDataFileMap ResourceDataFileMap; + using ResourceDataFileMap = RCCResourceLibrary::ResourceDataFileMap; const QByteArray *rc = nullptr; *errorCount = -1; contents->clear(); diff --git a/src/designer/src/lib/shared/selectsignaldialog.cpp b/src/designer/src/lib/shared/selectsignaldialog.cpp index 39d1bb145..67b988a56 100644 --- a/src/designer/src/lib/shared/selectsignaldialog.cpp +++ b/src/designer/src/lib/shared/selectsignaldialog.cpp @@ -53,7 +53,7 @@ namespace qdesigner_internal { enum { MethodRole = Qt::UserRole + 1 }; -typedef QVector Methods; +using Methods = QVector; SelectSignalDialog::SelectSignalDialog(QWidget *parent) : QDialog(parent) diff --git a/src/designer/src/lib/shared/shared_settings_p.h b/src/designer/src/lib/shared/shared_settings_p.h index f08691203..65dcf29bc 100644 --- a/src/designer/src/lib/shared/shared_settings_p.h +++ b/src/designer/src/lib/shared/shared_settings_p.h @@ -67,7 +67,7 @@ namespace qdesigner_internal { class QDESIGNER_SHARED_EXPORT QDesignerSharedSettings { public: - typedef QList DeviceProfileList; + using DeviceProfileList = QList; explicit QDesignerSharedSettings(QDesignerFormEditorInterface *core); diff --git a/src/designer/src/lib/shared/widgetdatabase.cpp b/src/designer/src/lib/shared/widgetdatabase.cpp index 0b79041ce..1a9297e73 100644 --- a/src/designer/src/lib/shared/widgetdatabase.cpp +++ b/src/designer/src/lib/shared/widgetdatabase.cpp @@ -348,8 +348,8 @@ static WidgetDataBaseItem *createCustomWidgetItem(const QDesignerCustomWidgetInt void WidgetDataBase::loadPlugins() { typedef QMap NameIndexMap; - typedef QList ItemList; - typedef QSet NameSet; + using ItemList = QList; + using NameSet = QSet; // 1) create a map of existing custom classes NameIndexMap existingCustomClasses; NameSet nonCustomClasses; @@ -539,7 +539,7 @@ QStringList WidgetDataBase::customFormWidgetClasses(const QDesignerFormEditorInt // properties to be suitable for new forms static QString xmlFromWidgetBox(const QDesignerFormEditorInterface *core, const QString &className, const QString &objectName) { - typedef QList PropertyList; + using PropertyList = QList; QDesignerWidgetBoxInterface::Widget widget; const bool found = QDesignerWidgetBox::findWidget(core->widgetBox(), className, QString(), &widget); diff --git a/src/designer/src/lib/shared/widgetdatabase_p.h b/src/designer/src/lib/shared/widgetdatabase_p.h index e8afa1064..44dcd4f18 100644 --- a/src/designer/src/lib/shared/widgetdatabase_p.h +++ b/src/designer/src/lib/shared/widgetdatabase_p.h @@ -136,7 +136,7 @@ private: enum IncludeType { IncludeLocal, IncludeGlobal }; -typedef QPair IncludeSpecification; +using IncludeSpecification = QPair; QDESIGNER_SHARED_EXPORT IncludeSpecification includeSpecification(QString includeFile); QDESIGNER_SHARED_EXPORT QString buildIncludeFile(QString includeFile, IncludeType includeType); @@ -184,7 +184,7 @@ QDESIGNER_SHARED_EXPORT QDesignerWidgetDataBaseItemInterface bool promoted, bool custom); -typedef QList WidgetDataBaseItemList; +using WidgetDataBaseItemList = QList; QDESIGNER_SHARED_EXPORT WidgetDataBaseItemList promotionCandidates(const QDesignerWidgetDataBaseInterface *db, diff --git a/src/designer/src/lib/shared/widgetfactory_p.h b/src/designer/src/lib/shared/widgetfactory_p.h index 1c85339c5..e9fd4bfe6 100644 --- a/src/designer/src/lib/shared/widgetfactory_p.h +++ b/src/designer/src/lib/shared/widgetfactory_p.h @@ -154,13 +154,13 @@ private: const Strings m_strings; QDesignerFormEditorInterface *m_core; - typedef QMap CustomWidgetFactoryMap; + using CustomWidgetFactoryMap = QMap; CustomWidgetFactoryMap m_customFactory; QDesignerFormWindowInterface *m_formWindow; // Points to the cached style or 0 if the default (qApp) is active QStyle *m_currentStyle; - typedef QHash StyleCache; + using StyleCache = QHash; StyleCache m_styleCache; }; diff --git a/src/designer/src/lib/shared/zoomwidget.cpp b/src/designer/src/lib/shared/zoomwidget.cpp index f9d59c3df..fef509a39 100644 --- a/src/designer/src/lib/shared/zoomwidget.cpp +++ b/src/designer/src/lib/shared/zoomwidget.cpp @@ -43,8 +43,8 @@ QT_BEGIN_NAMESPACE -typedef QList ActionList; -typedef QList GraphicsItemList; +using ActionList = QList; +using GraphicsItemList = QList; enum { debugZoomWidget = 0 }; diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp index e759406b8..bc7ba02bf 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.cpp +++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp @@ -199,7 +199,7 @@ QWidget *QAbstractFormBuilder::load(QIODevice *dev, QWidget *parentWidget) */ QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget) { - typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash; + using ButtonGroupHash = QFormBuilderExtra::ButtonGroupHash; d->clear(); if (const DomLayoutDefault *def = ui->elementLayoutDefault()) { @@ -2066,7 +2066,7 @@ void QAbstractFormBuilder::saveComboBoxExtraInfo(QComboBox *comboBox, DomWidget void QAbstractFormBuilder::saveButtonExtraInfo(const QAbstractButton *widget, DomWidget *ui_widget, DomWidget *) { - typedef QList DomPropertyList; + using DomPropertyList = QList; if (const QButtonGroup *buttonGroup = widget->group()) { DomPropertyList attributes = ui_widget->elementAttribute(); DomString *domString = new DomString(); @@ -2434,7 +2434,7 @@ static QString buttonGroupName(const DomWidget *ui_widget) void QAbstractFormBuilder::loadButtonExtraInfo(const DomWidget *ui_widget, QAbstractButton *button, QWidget *) { - typedef QFormBuilderExtra::ButtonGroupHash ButtonGroupHash; + using ButtonGroupHash = QFormBuilderExtra::ButtonGroupHash; const QString groupName = buttonGroupName(ui_widget); if (groupName.isEmpty()) diff --git a/src/designer/src/lib/uilib/abstractformbuilder.h b/src/designer/src/lib/uilib/abstractformbuilder.h index 8d015c91f..bf2e9d5d5 100644 --- a/src/designer/src/lib/uilib/abstractformbuilder.h +++ b/src/designer/src/lib/uilib/abstractformbuilder.h @@ -218,7 +218,7 @@ protected: QVariant toVariant(const QMetaObject *meta, DomProperty *property); static QString toString(const DomString *str); - typedef QHash DomPropertyHash; + using DomPropertyHash = QHash; static DomPropertyHash propertyMap(const QList &properties); void setupColorGroup(QPalette &palette, QPalette::ColorGroup colorGroup, DomColorGroup *group); @@ -239,7 +239,7 @@ protected: // Icon/pixmap stuff // // A Pair of icon path/qrc path. - typedef QPair IconPaths; + using IconPaths = QPair; IconPaths iconPaths(const QIcon &) const; IconPaths pixmapPaths(const QPixmap &) const; diff --git a/src/designer/src/lib/uilib/formbuilderextra_p.h b/src/designer/src/lib/uilib/formbuilderextra_p.h index 3b46c966b..54fbfbe66 100644 --- a/src/designer/src/lib/uilib/formbuilderextra_p.h +++ b/src/designer/src/lib/uilib/formbuilderextra_p.h @@ -147,8 +147,8 @@ public: // --- Hash used in creating button groups on demand. Store a map of name and pair of dom group and real group void registerButtonGroups(const DomButtonGroups *groups); - typedef QPair ButtonGroupEntry; - typedef QHash ButtonGroupHash; + using ButtonGroupEntry = QPair; + using ButtonGroupHash = QHash; const ButtonGroupHash &buttonGroups() const { return m_buttonGroups; } ButtonGroupHash &buttonGroups() { return m_buttonGroups; } @@ -191,7 +191,7 @@ private: void clearResourceBuilder(); void clearTextBuilder(); - typedef QHash BuddyHash; + using BuddyHash = QHash; BuddyHash m_buddies; QHash m_customWidgetDataHash; @@ -256,14 +256,14 @@ struct QDESIGNER_UILIB_EXPORT QFormBuilderStrings { const QString scriptWidgetVariable; const QString scriptChildWidgetsVariable; - typedef QPair RoleNName; + using RoleNName = QPair; QList itemRoles; QHash treeItemRoleHash; // first.first is primary role, first.second is shadow role. // Shadow is used for either the translation source or the designer // representation of the string value. - typedef QPair, QString> TextRoleNName; + using TextRoleNName = QPair, QString>; QList itemTextRoles; QHash > treeItemTextRoleHash; }; diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp index 2d5bf439a..097512373 100644 --- a/src/designer/src/uitools/quiloader.cpp +++ b/src/designer/src/uitools/quiloader.cpp @@ -330,7 +330,7 @@ class FormBuilderPrivate: public QFormBuilder { friend class QT_PREPEND_NAMESPACE(QUiLoader); friend class QT_PREPEND_NAMESPACE(QUiLoaderPrivate); - typedef QFormBuilder ParentClass; + using ParentClass = QFormBuilder; public: QUiLoader *loader = nullptr; -- cgit v1.2.3