summaryrefslogtreecommitdiff
path: root/src/designer/src/components
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-23 03:03:53 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-11-23 03:03:53 +0100
commit49c9aa0abb36cdb4b12bb88afd1764e28b90d111 (patch)
treeeca097a7d065fcea7e5aa7b77422af4a8acb8507 /src/designer/src/components
parentff2a2d1c7df2dbf35a2ea50cded2f850ca39a7d4 (diff)
parent16440300f29f270f74251d498249e9eef9dc254b (diff)
downloadqttools-49c9aa0abb36cdb4b12bb88afd1764e28b90d111.tar.gz
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ib7e4d5d1f997c67bb68f4c5cb20adb4a5e26f6f5
Diffstat (limited to 'src/designer/src/components')
-rw-r--r--src/designer/src/components/buddyeditor/buddyeditor.cpp15
-rw-r--r--src/designer/src/components/formeditor/deviceprofiledialog.cpp2
-rw-r--r--src/designer/src/components/formeditor/embeddedoptionspage.cpp3
-rw-r--r--src/designer/src/components/formeditor/formwindow.cpp9
-rw-r--r--src/designer/src/components/formeditor/previewactiongroup.cpp7
-rw-r--r--src/designer/src/components/formeditor/qmdiarea_container.cpp2
-rw-r--r--src/designer/src/components/formeditor/qwizard_container.cpp15
-rw-r--r--src/designer/src/components/formeditor/templateoptionspage.cpp7
-rw-r--r--src/designer/src/components/formeditor/tool_widgeteditor.cpp2
-rw-r--r--src/designer/src/components/objectinspector/objectinspectormodel.cpp45
-rw-r--r--src/designer/src/components/objectinspector/objectinspectormodel_p.h3
-rw-r--r--src/designer/src/components/propertyeditor/designerpropertymanager.cpp24
-rw-r--r--src/designer/src/components/propertyeditor/propertyeditor.cpp20
-rw-r--r--src/designer/src/components/signalsloteditor/connectdialog.cpp12
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp35
-rw-r--r--src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp8
-rw-r--r--src/designer/src/components/taskmenu/layouttaskmenu.cpp2
-rw-r--r--src/designer/src/components/taskmenu/toolbar_taskmenu.cpp2
-rw-r--r--src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp2
-rw-r--r--src/designer/src/components/widgetbox/widgetboxtreewidget.cpp8
20 files changed, 98 insertions, 125 deletions
diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp
index 93e143c2a..8fb9184e1 100644
--- a/src/designer/src/components/buddyeditor/buddyeditor.cpp
+++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp
@@ -41,6 +41,7 @@
#include <metadatabase_p.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qvector.h>
#include <QtWidgets/qlabel.h>
#include <QtWidgets/qmenu.h>
#include <QtWidgets/qaction.h>
@@ -83,8 +84,6 @@ static QString buddy(QLabel *label, QDesignerFormEditorInterface *core)
return sheet->property(prop_idx).toString();
}
-using LabelList = QList<QLabel *>;
-
namespace qdesigner_internal {
/*******************************************************************************
@@ -143,8 +142,8 @@ void BuddyEditor::updateBackground()
ConnectionEdit::updateBackground();
m_updating = true;
- QList<Connection *> newList;
- const LabelList label_list = background()->findChildren<QLabel*>();
+ QVector<Connection *> newList;
+ const auto label_list = background()->findChildren<QLabel*>();
for (QLabel *label : label_list) {
const QString buddy_name = buddy(label, m_formWindow->core());
if (buddy_name.isEmpty())
@@ -165,7 +164,7 @@ void BuddyEditor::updateBackground()
newList.append(con);
}
- QList<Connection *> toRemove;
+ QVector<Connection *> toRemove;
const int c = connectionCount();
for (int i = 0; i < c; i++) {
@@ -212,7 +211,7 @@ void BuddyEditor::setBackground(QWidget *background)
clear();
ConnectionEdit::setBackground(background);
- const LabelList label_list = background->findChildren<QLabel*>();
+ const auto label_list = background->findChildren<QLabel*>();
for (QLabel *label : label_list) {
const QString buddy_name = buddy(label, m_formWindow->core());
if (buddy_name.isEmpty())
@@ -328,7 +327,7 @@ void BuddyEditor::deleteSelected()
void BuddyEditor::autoBuddy()
{
// Any labels?
- LabelList labelList = background()->findChildren<QLabel*>();
+ auto labelList = background()->findChildren<QLabel*>();
if (labelList.isEmpty())
return;
// Find already used buddies
@@ -338,7 +337,7 @@ void BuddyEditor::autoBuddy()
usedBuddies.push_back(c->widget(EndPoint::Target));
// Find potential new buddies, keep lists in sync
QWidgetList buddies;
- for (LabelList::iterator it = labelList.begin(); it != labelList.end(); ) {
+ for (auto it = labelList.begin(); it != labelList.end(); ) {
QLabel *label = *it;
QWidget *newBuddy = nullptr;
if (m_formWindow->isManaged(label)) {
diff --git a/src/designer/src/components/formeditor/deviceprofiledialog.cpp b/src/designer/src/components/formeditor/deviceprofiledialog.cpp
index 40a9e6ab6..ef1693c39 100644
--- a/src/designer/src/components/formeditor/deviceprofiledialog.cpp
+++ b/src/designer/src/components/formeditor/deviceprofiledialog.cpp
@@ -73,7 +73,7 @@ DeviceProfileDialog::DeviceProfileDialog(QDesignerDialogGuiInterface *dlgGui, QW
setModal(true);
m_ui->setupUi(this);
- const QList<int> standardFontSizes = QFontDatabase::standardSizes();
+ const auto standardFontSizes = QFontDatabase::standardSizes();
populateNumericCombo(standardFontSizes.constBegin(), standardFontSizes.constEnd(), m_ui->m_systemFontSizeCombo);
// 288pt observed on macOS.
diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.cpp b/src/designer/src/components/formeditor/embeddedoptionspage.cpp
index 91474c6aa..85cc1f930 100644
--- a/src/designer/src/components/formeditor/embeddedoptionspage.cpp
+++ b/src/designer/src/components/formeditor/embeddedoptionspage.cpp
@@ -52,6 +52,7 @@
#include <QtWidgets/qgroupbox.h>
#include <QtCore/qset.h>
+#include <QtCore/qvector.h>
#include <algorithm>
@@ -59,7 +60,7 @@ QT_BEGIN_NAMESPACE
namespace qdesigner_internal {
-using DeviceProfileList = QList<DeviceProfile>;
+using DeviceProfileList = QVector<DeviceProfile>;
enum { profileComboIndexOffset = 1 };
diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp
index 91896f06a..84e065bcb 100644
--- a/src/designer/src/components/formeditor/formwindow.cpp
+++ b/src/designer/src/components/formeditor/formwindow.cpp
@@ -75,6 +75,7 @@
#include <QtCore/qdebug.h>
#include <QtCore/qbuffer.h>
#include <QtCore/qtimer.h>
+#include <QtCore/qvector.h>
#include <QtCore/qxmlstream.h>
#include <QtWidgets/qmenu.h>
#include <QtWidgets/qaction.h>
@@ -162,7 +163,7 @@ public:
private:
- using SelectionPool = QList<WidgetSelection *>;
+ using SelectionPool = QVector<WidgetSelection *>;
SelectionPool m_selectionPool;
typedef QHash<QWidget *, WidgetSelection *> SelectionHash;
@@ -1159,15 +1160,15 @@ bool FormWindow::unify(QObject *w, QString &s, bool changeIt)
if (!widgetChildren.isEmpty())
insertNames(metaDataBase, widgetChildren.constBegin(), widgetChildren.constEnd(), w, existingNames);
- const QList<QLayout *> layoutChildren = main->findChildren<QLayout*>();
+ const auto layoutChildren = main->findChildren<QLayout*>();
if (!layoutChildren.isEmpty())
insertNames(metaDataBase, layoutChildren.constBegin(), layoutChildren.constEnd(), w, existingNames);
- const QList<QAction *> actionChildren = main->findChildren<QAction*>();
+ const auto actionChildren = main->findChildren<QAction*>();
if (!actionChildren.isEmpty())
insertNames(metaDataBase, actionChildren.constBegin(), actionChildren.constEnd(), w, existingNames);
- const QList<QButtonGroup *> buttonGroupChildren = main->findChildren<QButtonGroup*>();
+ const auto buttonGroupChildren = main->findChildren<QButtonGroup*>();
if (!buttonGroupChildren.isEmpty())
insertNames(metaDataBase, buttonGroupChildren.constBegin(), buttonGroupChildren.constEnd(), w, existingNames);
diff --git a/src/designer/src/components/formeditor/previewactiongroup.cpp b/src/designer/src/components/formeditor/previewactiongroup.cpp
index e0f3b7db1..a85fb22c0 100644
--- a/src/designer/src/components/formeditor/previewactiongroup.cpp
+++ b/src/designer/src/components/formeditor/previewactiongroup.cpp
@@ -91,12 +91,9 @@ PreviewActionGroup::PreviewActionGroup(QDesignerFormEditorInterface *core, QObje
void PreviewActionGroup::updateDeviceProfiles()
{
- using DeviceProfileList = QList<DeviceProfile>;
- using ActionList = QList<QAction *>;
-
const QDesignerSharedSettings settings(m_core);
- const DeviceProfileList profiles = settings.deviceProfiles();
- const ActionList al = actions();
+ const auto profiles = settings.deviceProfiles();
+ const auto al = actions();
// Separator?
const bool hasProfiles = !profiles.isEmpty();
al.at(MaxDeviceActions)->setVisible(hasProfiles);
diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp
index e1930501f..03fe667a3 100644
--- a/src/designer/src/components/formeditor/qmdiarea_container.cpp
+++ b/src/designer/src/components/formeditor/qmdiarea_container.cpp
@@ -117,7 +117,7 @@ void QMdiAreaContainer::insertWidget(int, QWidget *widget)
void QMdiAreaContainer::remove(int index)
{
- QList<QMdiSubWindow *> subWins = m_mdiArea->subWindowList(QMdiArea::CreationOrder);
+ auto subWins = m_mdiArea->subWindowList(QMdiArea::CreationOrder);
if (index >= 0 && index < subWins.size()) {
QMdiSubWindow *f = subWins.at(index);
m_mdiArea->removeSubWindow(f->widget());
diff --git a/src/designer/src/components/formeditor/qwizard_container.cpp b/src/designer/src/components/formeditor/qwizard_container.cpp
index 5853fbf98..9acb4988c 100644
--- a/src/designer/src/components/formeditor/qwizard_container.cpp
+++ b/src/designer/src/components/formeditor/qwizard_container.cpp
@@ -33,11 +33,11 @@
#include <QtWidgets/qwizard.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qvector.h>
QT_BEGIN_NAMESPACE
-using IdList = QList<int>;
-using WizardPageList = QList<QWizardPage *>;
+using WizardPageList = QVector<QWizardPage *>;
namespace qdesigner_internal {
@@ -56,7 +56,7 @@ QWidget *QWizardContainer::widget(int index) const
{
QWidget *rc = nullptr;
if (index >= 0) {
- const IdList idList = m_wizard->pageIds();
+ const auto idList = m_wizard->pageIds();
if (index < idList.size())
rc = m_wizard->page(idList.at(index));
}
@@ -117,7 +117,7 @@ void QWizardContainer::insertWidget(int index, QWidget *widget)
return;
}
- const IdList idList = m_wizard->pageIds();
+ const auto idList = m_wizard->pageIds();
const int pageCount = idList.size();
if (index >= pageCount) {
addWidget(widget);
@@ -139,9 +139,8 @@ void QWizardContainer::insertWidget(int index, QWidget *widget)
m_wizard->removePage(idList.at(i));
}
int newId = idBefore + delta;
- const WizardPageList::const_iterator wcend = pageList.constEnd();
- for (WizardPageList::const_iterator it = pageList.constBegin(); it != wcend; ++it) {
- m_wizard->setPage(newId, *it);
+ for (QWizardPage *page : qAsConst(pageList)) {
+ m_wizard->setPage(newId, page);
newId += delta;
}
} else {
@@ -157,7 +156,7 @@ void QWizardContainer::remove(int index)
if (index < 0)
return;
- const IdList idList = m_wizard->pageIds();
+ const auto idList = m_wizard->pageIds();
if (index >= idList.size())
return;
diff --git a/src/designer/src/components/formeditor/templateoptionspage.cpp b/src/designer/src/components/formeditor/templateoptionspage.cpp
index e50260406..4e638c913 100644
--- a/src/designer/src/components/formeditor/templateoptionspage.cpp
+++ b/src/designer/src/components/formeditor/templateoptionspage.cpp
@@ -96,7 +96,7 @@ void TemplateOptionsWidget::addTemplatePath()
if (templatePath.isEmpty())
return;
- const QList<QListWidgetItem *> existing
+ const auto existing
= m_ui->m_templatePathListWidget->findItems(templatePath, Qt::MatchExactly);
if (!existing.isEmpty())
return;
@@ -108,8 +108,7 @@ void TemplateOptionsWidget::addTemplatePath()
void TemplateOptionsWidget::removeTemplatePath()
{
- const QList<QListWidgetItem *> selectedPaths
- = m_ui->m_templatePathListWidget->selectedItems();
+ const auto selectedPaths = m_ui->m_templatePathListWidget->selectedItems();
if (selectedPaths.isEmpty())
return;
delete selectedPaths.constFirst();
@@ -117,7 +116,7 @@ void TemplateOptionsWidget::removeTemplatePath()
void TemplateOptionsWidget::templatePathSelectionChanged()
{
- const QList<QListWidgetItem *> selectedPaths = m_ui->m_templatePathListWidget->selectedItems();
+ const auto selectedPaths = m_ui->m_templatePathListWidget->selectedItems();
m_ui->m_removeTemplatePathButton->setEnabled(!selectedPaths.isEmpty());
}
diff --git a/src/designer/src/components/formeditor/tool_widgeteditor.cpp b/src/designer/src/components/formeditor/tool_widgeteditor.cpp
index d3ecf8087..bdfdc2675 100644
--- a/src/designer/src/components/formeditor/tool_widgeteditor.cpp
+++ b/src/designer/src/components/formeditor/tool_widgeteditor.cpp
@@ -222,7 +222,7 @@ void WidgetEditorTool::detectDockDrag(const QDesignerMimeData *mimeData)
if (!mw)
return;
- const QList<QDesignerDnDItemInterface*> item_list = mimeData->items();
+ const auto item_list = mimeData->items();
for (QDesignerDnDItemInterface *item : item_list) {
if (item->decoration() && item->decoration()->property("_q_dockDrag").toBool())
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
index b980d3967..f6e7c78f2 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp
+++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
@@ -260,8 +260,6 @@ namespace qdesigner_internal {
setItemsDisplayData(row, icons, ClassNameChanged|ObjectNameChanged|ClassIconChanged|TypeChanged|LayoutTypeChanged);
}
- using ObjectModel = QList<ObjectData>;
-
// Recursive routine that creates the model by traversing the form window object tree.
void createModelRecursion(const QDesignerFormWindowInterface *fwi,
QObject *parent,
@@ -269,9 +267,7 @@ namespace qdesigner_internal {
ObjectModel &model,
const ModelRecursionContext &ctx)
{
- using ButtonGroupList = QList<QButtonGroup *>;
- using ActionList = QList<QAction *>;
-
+ using ButtonGroupList = QVector<QButtonGroup *>;
// 1) Create entry
const ObjectData entry(parent, object, ctx);
model.push_back(entry);
@@ -289,46 +285,41 @@ namespace qdesigner_internal {
}
}
- QObjectList children = object->children();
- if (!children.isEmpty()) {
+ if (!object->children().isEmpty()) {
ButtonGroupList buttonGroups;
+ QObjectList children = object->children();
std::sort(children.begin(), children.end(), sortEntry);
- const QObjectList::const_iterator cend = children.constEnd();
- for (QObjectList::const_iterator it = children.constBegin(); it != cend; ++it) {
+ for (QObject *childObject : qAsConst(children)) {
// Managed child widgets unless we had a container extension
- if ((*it)->isWidgetType()) {
+ if (childObject->isWidgetType()) {
if (!containerExtension) {
- QWidget *widget = qobject_cast<QWidget*>(*it);
+ QWidget *widget = qobject_cast<QWidget*>(childObject);
if (fwi->isManaged(widget))
createModelRecursion(fwi, object, widget, model, ctx);
}
} else {
- if (ctx.mdb->item(*it)) {
- if (QButtonGroup *bg = qobject_cast<QButtonGroup*>(*it))
+ if (ctx.mdb->item(childObject)) {
+ if (auto bg = qobject_cast<QButtonGroup*>(childObject))
buttonGroups.push_back(bg);
} // Has MetaDataBase entry
}
}
// Add button groups
if (!buttonGroups.isEmpty()) {
- const ButtonGroupList::const_iterator bgcend = buttonGroups.constEnd();
- for (ButtonGroupList::const_iterator bgit = buttonGroups.constBegin(); bgit != bgcend; ++bgit)
- createModelRecursion(fwi, object, *bgit, model, ctx);
+ for (QButtonGroup *group : qAsConst(buttonGroups))
+ createModelRecursion(fwi, object, group, model, ctx);
}
} // has children
if (object->isWidgetType()) {
// Add actions
- const ActionList actions = static_cast<QWidget*>(object)->actions();
- if (!actions.isEmpty()) {
- const ActionList::const_iterator cend = actions.constEnd();
- for (ActionList::const_iterator it = actions.constBegin(); it != cend; ++it)
- if (ctx.mdb->item(*it)) {
- QAction *action = *it;
- QObject *obj = action;
- if (action->menu())
- obj = action->menu();
- createModelRecursion(fwi, object, obj, model, ctx);
- }
+ const auto actions = static_cast<QWidget*>(object)->actions();
+ for (QAction *action : actions) {
+ if (ctx.mdb->item(action)) {
+ QObject *childObject = action;
+ if (auto menu = action->menu())
+ childObject = menu;
+ createModelRecursion(fwi, object, childObject, model, ctx);
+ }
}
}
}
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel_p.h b/src/designer/src/components/objectinspector/objectinspectormodel_p.h
index f138253a5..14bcf78cb 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel_p.h
+++ b/src/designer/src/components/objectinspector/objectinspectormodel_p.h
@@ -48,6 +48,7 @@
#include <QtCore/qlist.h>
#include <QtCore/qmap.h>
#include <QtCore/qpointer.h>
+#include <QtCore/qvector.h>
QT_BEGIN_NAMESPACE
@@ -114,7 +115,7 @@ 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); }
- using ObjectModel = QList<ObjectData>;
+ using ObjectModel = QVector<ObjectData>;
// QStandardItemModel for ObjectInspector. Uses ObjectData/ObjectModel
// internally for its updates.
diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
index ad1b6505c..27d265696 100644
--- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
+++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
@@ -1012,7 +1012,7 @@ void DesignerPropertyManager::slotValueChanged(QtProperty *property, const QVari
}
if (QtProperty *flagProperty = m_flagToProperty.value(property, 0)) {
- const QList<QtProperty *> subFlags = m_propertyToFlags.value(flagProperty);
+ const auto subFlags = m_propertyToFlags.value(flagProperty);
const int subFlagCount = subFlags.count();
// flag changed
const bool subValue = variantProperty(property)->value().toBool();
@@ -1025,7 +1025,7 @@ void DesignerPropertyManager::slotValueChanged(QtProperty *property, const QVari
m_changingSubValue = true;
FlagData data = m_flagValues.value(flagProperty);
- const QList<uint> values = data.values;
+ const auto values = data.values;
// Compute new value, without including (additional) supermasks
if (values.at(subIndex) == 0) {
for (int i = 0; i < subFlagCount; ++i) {
@@ -1123,7 +1123,7 @@ void DesignerPropertyManager::slotPropertyDestroyed(QtProperty *property)
{
if (QtProperty *flagProperty = m_flagToProperty.value(property, 0)) {
PropertyToPropertyListMap::iterator it = m_propertyToFlags.find(flagProperty);
- QList<QtProperty *> &propertyList = it.value();
+ auto &propertyList = it.value();
propertyList.replace(propertyList.indexOf(property), 0);
m_flagToProperty.remove(property);
} else if (QtProperty *alignProperty = m_alignHToProperty.value(property, 0)) {
@@ -1516,15 +1516,13 @@ QString DesignerPropertyManager::valueText(const QtProperty *property) const
const uint v = data.val;
const QChar bar = QLatin1Char('|');
QString valueStr;
- const QList<QPair<QString, uint> > flags = data.flags;
- const QList<QPair<QString, uint> >::const_iterator fcend = flags.constEnd();
- for (QList<QPair<QString, uint> >::const_iterator it = flags.constBegin(); it != fcend; ++it) {
- const uint val = it->second;
+ for (const DesignerIntPair &p : data.flags) {
+ const uint val = p.second;
const bool checked = (val == 0) ? (v == 0) : ((val & v) == val);
if (checked) {
if (!valueStr.isEmpty())
valueStr += bar;
- valueStr += it->first;
+ valueStr += p.first;
}
}
return valueStr;
@@ -1754,8 +1752,8 @@ void DesignerPropertyManager::setValue(QtProperty *property, const QVariant &val
// set Value
- const QList<uint> values = data.values;
- const QList<QtProperty *> subFlags = m_propertyToFlags.value(property);
+ const auto values = data.values;
+ const auto subFlags = m_propertyToFlags.value(property);
const int subFlagCount = subFlags.count();
for (int i = 0; i < subFlagCount; ++i) {
QtVariantProperty *subFlag = variantProperty(subFlags.at(i));
@@ -2317,7 +2315,7 @@ void DesignerEditorFactory::slotPropertyChanged(QtProperty *property)
defaultPixmap = qvariant_cast<QIcon>(manager->attributeValue(property, QLatin1String(defaultResourceAttributeC))).pixmap(16, 16);
else if (m_fwb)
defaultPixmap = m_fwb->iconCache()->icon(qvariant_cast<PropertySheetIconValue>(manager->value(property))).pixmap(16, 16);
- const QList<PixmapEditor *> editors = m_iconPropertyToEditors.value(property);
+ const auto editors = m_iconPropertyToEditors.value(property);
for (PixmapEditor *editor : editors)
editor->setDefaultPixmap(defaultPixmap);
}
@@ -2746,7 +2744,7 @@ ResetDecorator::ResetDecorator(const QDesignerFormEditorInterface *core, QObject
ResetDecorator::~ResetDecorator()
{
- const QList<ResetWidget *> editors = m_resetWidgetToProperty.keys();
+ const auto editors = m_resetWidgetToProperty.keys();
qDeleteAll(editors);
}
@@ -2819,7 +2817,7 @@ QWidget *ResetDecorator::editor(QWidget *subEditor, bool resettable, QtAbstractP
void ResetDecorator::slotPropertyChanged(QtProperty *property)
{
- QMap<QtProperty *, QList<ResetWidget *> >::ConstIterator prIt = m_createdResetWidgets.constFind(property);
+ const auto prIt = m_createdResetWidgets.constFind(property);
if (prIt == m_createdResetWidgets.constEnd())
return;
diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp
index 85724eb01..392f1c3f5 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -452,13 +452,13 @@ void PropertyEditor::storePropertiesExpansionState(const QList<QtBrowserItem *>
void PropertyEditor::storeExpansionState()
{
- const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
+ const auto items = m_currentBrowser->topLevelItems();
if (m_sorting) {
storePropertiesExpansionState(items);
} else {
for (QtBrowserItem *item : items) {
const QString groupName = item->property()->propertyName();
- QList<QtBrowserItem *> propertyItems = item->children();
+ auto propertyItems = item->children();
if (!propertyItems.isEmpty())
m_expansionState[groupName] = isExpanded(item);
@@ -470,7 +470,7 @@ void PropertyEditor::storeExpansionState()
void PropertyEditor::collapseAll()
{
- const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
+ const auto items = m_currentBrowser->topLevelItems();
for (QtBrowserItem *group : items)
setExpanded(group, false);
}
@@ -498,7 +498,7 @@ void PropertyEditor::applyPropertiesExpansionState(const QList<QtBrowserItem *>
void PropertyEditor::applyExpansionState()
{
- const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
+ const auto items = m_currentBrowser->topLevelItems();
if (m_sorting) {
applyPropertiesExpansionState(items);
} else {
@@ -533,7 +533,7 @@ int PropertyEditor::applyPropertiesFilter(const QList<QtBrowserItem *> &items)
void PropertyEditor::applyFilter()
{
- const QList<QtBrowserItem *> items = m_currentBrowser->topLevelItems();
+ const auto items = m_currentBrowser->topLevelItems();
if (m_sorting) {
applyPropertiesFilter(items);
} else {
@@ -664,7 +664,7 @@ void PropertyEditor::slotSorting(bool sort)
void PropertyEditor::updateColors()
{
if (m_treeBrowser && m_currentBrowser == m_treeBrowser) {
- const QList<QtBrowserItem *> items = m_treeBrowser->topLevelItems();
+ const auto items = m_treeBrowser->topLevelItems();
for (QtBrowserItem *item : items)
m_treeBrowser->setBackgroundColor(item, propertyColor(item->property()));
}
@@ -1092,7 +1092,7 @@ void PropertyEditor::setObject(QObject *object)
if (lastGroup != groupProperty) {
lastGroup = groupProperty;
lastProperty = nullptr; // Append at end
- const QList<QtProperty*> subProperties = lastGroup->subProperties();
+ const auto subProperties = lastGroup->subProperties();
if (!subProperties.isEmpty())
lastProperty = subProperties.constLast();
lastGroup = groupProperty;
@@ -1108,7 +1108,7 @@ void PropertyEditor::setObject(QObject *object)
property->setModified(m_propertySheet->isChanged(i));
if (propertyName == QStringLiteral("geometry") && type == QVariant::Rect) {
- const QList<QtProperty *> &subProperties = property->subProperties();
+ const auto &subProperties = property->subProperties();
for (QtProperty *subProperty : subProperties) {
const QString subPropertyName = subProperty->propertyName();
if (subPropertyName == QStringLiteral("X") || subPropertyName == QStringLiteral("Y"))
@@ -1157,7 +1157,7 @@ QtBrowserItem *PropertyEditor::nonFakePropertyBrowserItem(QtBrowserItem *item) c
{
// Top-level properties are QObject/QWidget groups, etc. Find first item property below
// which should be nonfake
- const QList<QtBrowserItem *> topLevelItems = m_currentBrowser->topLevelItems();
+ const auto topLevelItems = m_currentBrowser->topLevelItems();
do {
if (topLevelItems.contains(item->parent()))
return item;
@@ -1245,7 +1245,7 @@ void PropertyEditor::editProperty(const QString &name)
// find the browser item belonging to the property, make it current and edit it
QtBrowserItem *browserItem = nullptr;
if (QtVariantProperty *property = m_nameToProperty.value(name, 0)) {
- const QList<QtBrowserItem *> items = m_currentBrowser->items(property);
+ const auto items = m_currentBrowser->items(property);
if (items.size() == 1)
browserItem = items.constFirst();
}
diff --git a/src/designer/src/components/signalsloteditor/connectdialog.cpp b/src/designer/src/components/signalsloteditor/connectdialog.cpp
index 6eef6dcc7..dcb6f1ded 100644
--- a/src/designer/src/components/signalsloteditor/connectdialog.cpp
+++ b/src/designer/src/components/signalsloteditor/connectdialog.cpp
@@ -42,10 +42,6 @@
QT_BEGIN_NAMESPACE
-namespace {
- using ListWidgetItems = QList<QListWidgetItem *>;
-}
-
static QString realClassName(QDesignerFormEditorInterface *core, QWidget *widget)
{
QString class_name = QLatin1String(widget->metaObject()->className());
@@ -138,7 +134,7 @@ void ConnectDialog::populateLists()
void ConnectDialog::setSignalSlot(const QString &signal, const QString &slot)
{
- ListWidgetItems sigItems = m_ui.signalList->findItems(signal, Qt::MatchExactly);
+ auto sigItems = m_ui.signalList->findItems(signal, Qt::MatchExactly);
if (sigItems.isEmpty()) {
m_ui.showAllCheckBox->setChecked(true);
@@ -147,7 +143,7 @@ void ConnectDialog::setSignalSlot(const QString &signal, const QString &slot)
if (!sigItems.isEmpty()) {
selectSignal(sigItems.constFirst());
- ListWidgetItems slotItems = m_ui.slotList->findItems(slot, Qt::MatchExactly);
+ auto slotItems = m_ui.slotList->findItems(slot, Qt::MatchExactly);
if (slotItems.isEmpty()) {
m_ui.showAllCheckBox->setChecked(true);
slotItems = m_ui.slotList->findItems(slot, Qt::MatchExactly);
@@ -194,7 +190,7 @@ void ConnectDialog::selectSlot(QListWidgetItem *item)
QString ConnectDialog::signal() const
{
- const ListWidgetItems item_list = m_ui.signalList->selectedItems();
+ const auto item_list = m_ui.signalList->selectedItems();
if (item_list.size() != 1)
return QString();
return item_list.at(0)->text();
@@ -202,7 +198,7 @@ QString ConnectDialog::signal() const
QString ConnectDialog::slot() const
{
- const ListWidgetItems item_list = m_ui.slotList->selectedItems();
+ const auto item_list = m_ui.slotList->selectedItems();
if (item_list.size() != 1)
return QString();
return item_list.at(0)->text();
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
index 175b4f6a8..0868c9fe2 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
@@ -79,9 +79,6 @@ static void addWidgetToObjectList(const QWidget *w, QStringList &r)
static QStringList objectNameList(QDesignerFormWindowInterface *form)
{
- using ActionList = QList<QAction *>;
- using ButtonGroupList = QList<QButtonGroup *>;
-
QStringList result;
QWidget *mainContainer = form->mainContainer();
@@ -104,30 +101,24 @@ static QStringList objectNameList(QDesignerFormWindowInterface *form)
const QDesignerMetaDataBaseInterface *mdb = form->core()->metaDataBase();
// Add managed actions and actions with managed menus
- const ActionList actions = mainContainer->findChildren<QAction*>();
- if (!actions.isEmpty()) {
- const ActionList::const_iterator cend = actions.constEnd();
- for (ActionList::const_iterator it = actions.constBegin(); it != cend; ++it) {
- QAction *a = *it;
- if (!a->isSeparator()) {
- if (QMenu *menu = a->menu()) {
- if (mdb->item(menu))
- result.push_back(menu->objectName());
- } else {
- if (mdb->item(a))
- result.push_back(a->objectName());
- }
+ const auto actions = mainContainer->findChildren<QAction*>();
+ for (QAction *a : actions) {
+ if (!a->isSeparator()) {
+ if (QMenu *menu = a->menu()) {
+ if (mdb->item(menu))
+ result.push_back(menu->objectName());
+ } else {
+ if (mdb->item(a))
+ result.push_back(a->objectName());
}
}
}
// Add managed buttons groups
- const ButtonGroupList buttonGroups = mainContainer->findChildren<QButtonGroup *>();
- if (!buttonGroups.isEmpty()) {
- const ButtonGroupList::const_iterator cend = buttonGroups.constEnd();
- for (ButtonGroupList::const_iterator it = buttonGroups.constBegin(); it != cend; ++it)
- if (mdb->item(*it))
- result.append((*it)->objectName());
+ const auto buttonGroups = mainContainer->findChildren<QButtonGroup *>();
+ for (QButtonGroup * b : buttonGroups) {
+ if (mdb->item(b))
+ result.append(b->objectName());
}
result.sort();
diff --git a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
index 1df9e4bbb..b4cd1cb2b 100644
--- a/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/containerwidget_taskmenu.cpp
@@ -150,7 +150,7 @@ QList<QAction*> ContainerWidgetTaskMenu::taskActions() const
const QDesignerContainerExtension *ce = containerExtension();
const int index = ce->currentIndex();
- QList<QAction*> actions = QDesignerTaskMenu::taskActions();
+ auto actions = QDesignerTaskMenu::taskActions();
actions += m_taskActions;
// Update the page submenu, deletion and promotion. Updated on demand due to promotion state.
m_pageMenu->clear();
@@ -224,7 +224,7 @@ WizardContainerWidgetTaskMenu::WizardContainerWidgetTaskMenu(QWizard *w, QObject
{
connect(m_nextAction, &QAction::triggered, w, &QWizard::next);
connect(m_previousAction, &QAction::triggered, w, &QWizard::back);
- QList<QAction*> &l = containerActions();
+ auto &l = containerActions();
l.push_front(createSeparator());
l.push_front(m_nextAction);
l.push_front(m_previousAction);
@@ -260,7 +260,7 @@ void MdiContainerWidgetTaskMenu::initializeActions()
m_tileAction = new QAction(tr("Tile"), this);
m_cascadeAction = new QAction(tr("Cascade"), this);
- QList<QAction*> &l = containerActions();
+ auto &l = containerActions();
l.push_front(createSeparator());
l.push_front(m_tileAction);
l.push_front(m_cascadeAction);
@@ -271,7 +271,7 @@ void MdiContainerWidgetTaskMenu::initializeActions()
QList<QAction*> MdiContainerWidgetTaskMenu::taskActions() const
{
- const QList<QAction*> rc = ContainerWidgetTaskMenu::taskActions();
+ const auto rc = ContainerWidgetTaskMenu::taskActions();
// Enable
const int count = pageCount();
m_nextAction->setEnabled(count > 1);
diff --git a/src/designer/src/components/taskmenu/layouttaskmenu.cpp b/src/designer/src/components/taskmenu/layouttaskmenu.cpp
index 94c2095c4..b69051212 100644
--- a/src/designer/src/components/taskmenu/layouttaskmenu.cpp
+++ b/src/designer/src/components/taskmenu/layouttaskmenu.cpp
@@ -73,7 +73,7 @@ QAction *SpacerTaskMenu::preferredEditAction() const
QList<QAction*> SpacerTaskMenu::taskActions() const
{
- return QList<QAction*>();
+ return {};
}
QT_END_NAMESPACE
diff --git a/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp b/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp
index 158917e24..42f3b271a 100644
--- a/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/toolbar_taskmenu.cpp
@@ -58,7 +58,7 @@ namespace qdesigner_internal {
{
if (ToolBarEventFilter *ef = ToolBarEventFilter::eventFilterOf(m_toolBar))
return ef->contextMenuActions();
- return QList<QAction*>();
+ return {};
}
// ------------ StatusBarTaskMenu
diff --git a/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp b/src/designer/src/components/widgetbox/widgetboxcategorylistview.cpp
index 5b00ea68f..9863da25b 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:
- using WidgetBoxCategoryEntrys = QList<WidgetBoxCategoryEntry>;
+ using WidgetBoxCategoryEntrys = QVector<WidgetBoxCategoryEntry>;
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 a170fa7c7..054d622a0 100644
--- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
+++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
@@ -366,7 +366,7 @@ bool WidgetBoxTreeWidget::readCategories(const QString &fileName, const QString
while (!reader.atEnd()) {
switch (reader.readNext()) {
case QXmlStreamReader::StartElement: {
- const QStringRef tag = reader.name();
+ const auto tag = reader.name();
if (tag == QLatin1String(widgetBoxRootElementC)) {
//<widgetbox version="4.5">
continue;
@@ -411,7 +411,7 @@ bool WidgetBoxTreeWidget::readCategories(const QString &fileName, const QString
break;
}
case QXmlStreamReader::EndElement: {
- const QStringRef tag = reader.name();
+ const auto tag = reader.name();
if (tag == QLatin1String(widgetBoxRootElementC)) {
continue;
}
@@ -472,7 +472,7 @@ bool WidgetBoxTreeWidget::readWidget(Widget *w, const QString &xml, QXmlStreamRe
case QXmlStreamReader::StartElement:
if (nesting++ == 0) {
// First element must be <ui> or (legacy) <widget>
- const QStringRef name = r.name();
+ const auto name = r.name();
if (name == QLatin1String(uiElementC)) {
startTagPosition = currentPosition;
} else {
@@ -593,7 +593,7 @@ static int findCategory(const QString &name, const WidgetBoxTreeWidget::Category
static inline bool isValidIcon(const QIcon &icon)
{
if (!icon.isNull()) {
- const QList<QSize> availableSizes = icon.availableSizes();
+ const auto availableSizes = icon.availableSizes();
return !availableSizes.isEmpty() && !availableSizes.constFirst().isEmpty();
}
return false;