summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-11-08 13:49:49 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-11-15 16:23:21 +0100
commite8a4f4a92cfbab9fd43aea326dc5a7c88dbe390a (patch)
tree368c889fe1a1be32eea35730c7722cb6d04db8de
parentec4b367cc41375564b6869cea833b60484965ac9 (diff)
Qt Designer: Fix Qt API usage
Replace: empty() by isEmpty() front()/back() by constFirst()/constLast(), preventing detaching Streamline some code. Task-number: QTBUG-79896 Change-Id: Ic3f8414db79a83a30b55369a9352f332b41aa621 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
-rw-r--r--src/designer/src/components/buddyeditor/buddyeditor.cpp4
-rw-r--r--src/designer/src/components/formeditor/embeddedoptionspage.cpp2
-rw-r--r--src/designer/src/components/formeditor/formwindow.cpp18
-rw-r--r--src/designer/src/components/formeditor/formwindow_widgetstack.cpp2
-rw-r--r--src/designer/src/components/formeditor/formwindowmanager.cpp6
-rw-r--r--src/designer/src/components/formeditor/formwindowsettings.cpp2
-rw-r--r--src/designer/src/components/formeditor/layout_propertysheet.cpp2
-rw-r--r--src/designer/src/components/formeditor/previewactiongroup.cpp2
-rw-r--r--src/designer/src/components/formeditor/qdesigner_resource.cpp26
-rw-r--r--src/designer/src/components/formeditor/qmdiarea_container.cpp2
-rw-r--r--src/designer/src/components/formeditor/qwizard_container.cpp7
-rw-r--r--src/designer/src/components/formeditor/templateoptionspage.cpp10
-rw-r--r--src/designer/src/components/objectinspector/objectinspector.cpp28
-rw-r--r--src/designer/src/components/objectinspector/objectinspectormodel.cpp12
-rw-r--r--src/designer/src/components/propertyeditor/designerpropertymanager.cpp6
-rw-r--r--src/designer/src/components/propertyeditor/fontpropertymanager.cpp6
-rw-r--r--src/designer/src/components/propertyeditor/propertyeditor.cpp18
-rw-r--r--src/designer/src/components/signalsloteditor/connectdialog.cpp12
-rw-r--r--src/designer/src/components/signalsloteditor/signalslot_utils.cpp6
-rw-r--r--src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp4
-rw-r--r--src/designer/src/components/taskmenu/button_taskmenu.cpp12
-rw-r--r--src/designer/src/components/widgetbox/widgetbox_dnditem.cpp2
-rw-r--r--src/designer/src/components/widgetbox/widgetboxtreewidget.cpp7
-rw-r--r--src/designer/src/designer/appfontdialog.cpp8
-rw-r--r--src/designer/src/designer/mainwindow.cpp6
-rw-r--r--src/designer/src/designer/newform.cpp2
-rw-r--r--src/designer/src/designer/qdesigner.cpp2
-rw-r--r--src/designer/src/designer/qdesigner_workbench.cpp4
-rw-r--r--src/designer/src/lib/shared/actioneditor.cpp17
-rw-r--r--src/designer/src/lib/shared/actionrepository.cpp10
-rw-r--r--src/designer/src/lib/shared/connectionedit.cpp4
-rw-r--r--src/designer/src/lib/shared/dialoggui.cpp6
-rw-r--r--src/designer/src/lib/shared/formlayoutmenu.cpp2
-rw-r--r--src/designer/src/lib/shared/formwindowbase.cpp8
-rw-r--r--src/designer/src/lib/shared/layout.cpp2
-rw-r--r--src/designer/src/lib/shared/layoutinfo.cpp4
-rw-r--r--src/designer/src/lib/shared/morphmenu.cpp4
-rw-r--r--src/designer/src/lib/shared/newformwidget.cpp4
-rw-r--r--src/designer/src/lib/shared/pluginmanager.cpp4
-rw-r--r--src/designer/src/lib/shared/previewconfigurationwidget.cpp8
-rw-r--r--src/designer/src/lib/shared/previewmanager.cpp10
-rw-r--r--src/designer/src/lib/shared/promotionmodel.cpp6
-rw-r--r--src/designer/src/lib/shared/promotiontaskmenu.cpp8
-rw-r--r--src/designer/src/lib/shared/qdesigner_command.cpp16
-rw-r--r--src/designer/src/lib/shared/qdesigner_dnditem.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_formbuilder.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_introspection.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_membersheet.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_menu.cpp6
-rw-r--r--src/designer/src/lib/shared/qdesigner_menubar.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_objectinspector.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_promotion.cpp6
-rw-r--r--src/designer/src/lib/shared/qdesigner_promotiondialog.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_propertycommand.cpp6
-rw-r--r--src/designer/src/lib/shared/qdesigner_propertyeditor.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_propertysheet.cpp6
-rw-r--r--src/designer/src/lib/shared/qdesigner_tabwidget.cpp4
-rw-r--r--src/designer/src/lib/shared/qdesigner_toolbar.cpp5
-rw-r--r--src/designer/src/lib/shared/qdesigner_toolbox.cpp2
-rw-r--r--src/designer/src/lib/shared/qdesigner_utils.cpp2
-rw-r--r--src/designer/src/lib/shared/qlayout_widget.cpp6
-rw-r--r--src/designer/src/lib/shared/qsimpleresource.cpp4
-rw-r--r--src/designer/src/lib/shared/qtresourcemodel.cpp2
-rw-r--r--src/designer/src/lib/shared/shared_settings.cpp6
-rw-r--r--src/designer/src/lib/shared/signalslotdialog.cpp10
-rw-r--r--src/designer/src/lib/shared/textpropertyeditor.cpp2
-rw-r--r--src/designer/src/lib/shared/widgetdatabase.cpp6
-rw-r--r--src/designer/src/lib/uilib/abstractformbuilder.cpp12
-rw-r--r--src/designer/src/lib/uilib/formbuilder.cpp2
-rw-r--r--src/designer/src/lib/uilib/formbuilderextra.cpp6
-rw-r--r--src/designer/src/uitools/quiloader.cpp2
-rw-r--r--src/shared/fontpanel/fontpanel.cpp10
-rw-r--r--src/shared/qtpropertybrowser/qteditorfactory.cpp2
-rw-r--r--src/shared/qtpropertybrowser/qtpropertymanager.cpp4
-rw-r--r--src/shared/qttoolbardialog/qttoolbardialog.cpp4
76 files changed, 234 insertions, 234 deletions
diff --git a/src/designer/src/components/buddyeditor/buddyeditor.cpp b/src/designer/src/components/buddyeditor/buddyeditor.cpp
index 7593326db..93e143c2a 100644
--- a/src/designer/src/components/buddyeditor/buddyeditor.cpp
+++ b/src/designer/src/components/buddyeditor/buddyeditor.cpp
@@ -329,7 +329,7 @@ void BuddyEditor::autoBuddy()
{
// Any labels?
LabelList labelList = background()->findChildren<QLabel*>();
- if (labelList.empty())
+ if (labelList.isEmpty())
return;
// Find already used buddies
QWidgetList usedBuddies;
@@ -355,7 +355,7 @@ void BuddyEditor::autoBuddy()
}
}
// Add the list in one go.
- if (labelList.empty())
+ if (labelList.isEmpty())
return;
const int count = labelList.size();
Q_ASSERT(count == buddies.size());
diff --git a/src/designer/src/components/formeditor/embeddedoptionspage.cpp b/src/designer/src/components/formeditor/embeddedoptionspage.cpp
index 96a6c7c4a..91474c6aa 100644
--- a/src/designer/src/components/formeditor/embeddedoptionspage.cpp
+++ b/src/designer/src/components/formeditor/embeddedoptionspage.cpp
@@ -265,7 +265,7 @@ void EmbeddedOptionsControlPrivate::sortAndPopulateProfileCombo()
// Clear items until only "None" is left
for (int i = m_profileCombo->count() - 1; i > 0; i--)
m_profileCombo->removeItem(i);
- if (!m_sortedProfiles.empty()) {
+ if (!m_sortedProfiles.isEmpty()) {
std::sort(m_sortedProfiles.begin(), m_sortedProfiles.end(), deviceProfileLessThan);
m_profileCombo->addItems(existingProfileNames());
}
diff --git a/src/designer/src/components/formeditor/formwindow.cpp b/src/designer/src/components/formeditor/formwindow.cpp
index cc0f78e38..91896f06a 100644
--- a/src/designer/src/components/formeditor/formwindow.cpp
+++ b/src/designer/src/components/formeditor/formwindow.cpp
@@ -178,7 +178,7 @@ FormWindow::Selection::~Selection()
void FormWindow::Selection::clear()
{
- if (!m_usedSelections.empty()) {
+ if (!m_usedSelections.isEmpty()) {
for (auto it = m_usedSelections.begin(), mend = m_usedSelections.end(); it != mend; ++it)
it.value()->setWidget(nullptr);
m_usedSelections.clear();
@@ -741,7 +741,7 @@ bool FormWindow::handleMouseMoveEvent(QWidget *, QWidget *, QMouseEvent *e)
blockSelectionChanged(blocked);
- if (!sel.empty()) // reshow selection?
+ if (!sel.isEmpty()) // reshow selection?
if (QDesignerMimeData::execDrag(item_list, core()->topLevel()) == Qt::IgnoreAction && dropType == QDesignerDnDItemInterface::MoveDrop)
for (QWidget *widget : qAsConst(sel))
m_selection->show(widget);
@@ -946,7 +946,7 @@ bool FormWindow::isMainContainer(const QWidget *w) const
void FormWindow::updateChildSelections(QWidget *w)
{
const QWidgetList l = w->findChildren<QWidget*>();
- if (!l.empty()) {
+ if (!l.isEmpty()) {
const QWidgetList::const_iterator lcend = l.constEnd();
for (QWidgetList::const_iterator it = l.constBegin(); it != lcend; ++it) {
QWidget *w = *it;
@@ -1156,19 +1156,19 @@ bool FormWindow::unify(QObject *w, QString &s, bool changeIt)
const QDesignerMetaDataBaseInterface *metaDataBase = core()->metaDataBase();
const QWidgetList widgetChildren = main->findChildren<QWidget*>();
- if (!widgetChildren.empty())
+ if (!widgetChildren.isEmpty())
insertNames(metaDataBase, widgetChildren.constBegin(), widgetChildren.constEnd(), w, existingNames);
const QList<QLayout *> layoutChildren = main->findChildren<QLayout*>();
- if (!layoutChildren.empty())
+ if (!layoutChildren.isEmpty())
insertNames(metaDataBase, layoutChildren.constBegin(), layoutChildren.constEnd(), w, existingNames);
const QList<QAction *> actionChildren = main->findChildren<QAction*>();
- if (!actionChildren.empty())
+ if (!actionChildren.isEmpty())
insertNames(metaDataBase, actionChildren.constBegin(), actionChildren.constEnd(), w, existingNames);
const QList<QButtonGroup *> buttonGroupChildren = main->findChildren<QButtonGroup*>();
- if (!buttonGroupChildren.empty())
+ if (!buttonGroupChildren.isEmpty())
insertNames(metaDataBase, buttonGroupChildren.constBegin(), buttonGroupChildren.constEnd(), w, existingNames);
const StringSet::const_iterator enEnd = existingNames.constEnd();
@@ -1701,7 +1701,7 @@ QWidget *FormWindow::containerForPaste() const
// Try to find a close parent, for example a non-laid-out
// QFrame/QGroupBox when a widget within it is selected.
QWidgetList selection = selectedWidgets();
- if (selection.empty())
+ if (selection.isEmpty())
break;
simplifySelection(&selection);
@@ -2258,7 +2258,7 @@ QAction *FormWindow::createSelectAncestorSubMenu(QWidget *w)
for (QWidget *p = w->parentWidget(); p && p != mc; p = p->parentWidget())
if (isManaged(p) && !isWidgetSelected(p))
parents.push_back(p);
- if (parents.empty())
+ if (parents.isEmpty())
return nullptr;
// Create a submenu listing the managed, unselected parents
QMenu *menu = new QMenu;
diff --git a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp
index 18126c145..4c93c7674 100644
--- a/src/designer/src/components/formeditor/formwindow_widgetstack.cpp
+++ b/src/designer/src/components/formeditor/formwindow_widgetstack.cpp
@@ -165,7 +165,7 @@ void FormWindowWidgetStack::addTool(QDesignerFormWindowToolInterface *tool)
m_layout->addWidget(w);
} else {
// The form editor might not have a tool initially, use dummy. Assert on anything else
- Q_ASSERT(m_tools.empty());
+ Q_ASSERT(m_tools.isEmpty());
m_layout->addWidget(m_formContainer);
}
diff --git a/src/designer/src/components/formeditor/formwindowmanager.cpp b/src/designer/src/components/formeditor/formwindowmanager.cpp
index 73b315889..692b20c54 100644
--- a/src/designer/src/components/formeditor/formwindowmanager.cpp
+++ b/src/designer/src/components/formeditor/formwindowmanager.cpp
@@ -566,7 +566,7 @@ static inline QWidget *findLayoutContainer(const FormWindow *fw)
{
QWidgetList l(fw->selectedWidgets());
fw->simplifySelection(&l);
- return l.empty() ? fw->mainContainer() : l.front();
+ return l.isEmpty() ? fw->mainContainer() : l.constFirst();
}
void FormWindowManager::createLayout()
@@ -616,7 +616,7 @@ void FormWindowManager::slotActionSimplifyLayoutActivated()
if (selectedWidgets.size() != 1)
return;
SimplifyLayoutCommand *cmd = new SimplifyLayoutCommand(m_activeFormWindow);
- if (cmd->init(selectedWidgets.front())) {
+ if (cmd->init(selectedWidgets.constFirst())) {
m_activeFormWindow->commandHistory()->push(cmd);
} else {
delete cmd;
@@ -753,7 +753,7 @@ QSet<QWidget *> FormWindowManager::getUnsortedLayoutsToBeBroken(bool firstOnly)
for (QWidget *selectedWidget : qAsConst(selection)) {
// find all layouts
const QWidgetList &list = layoutsToBeBroken(selectedWidget);
- if (!list.empty()) {
+ if (!list.isEmpty()) {
for (QWidget *widget : list)
layouts.insert(widget);
if (firstOnly)
diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp
index 4ccd7210b..de03c6792 100644
--- a/src/designer/src/components/formeditor/formwindowsettings.cpp
+++ b/src/designer/src/components/formeditor/formwindowsettings.cpp
@@ -244,7 +244,7 @@ void FormWindowSettings::setData(const FormWindowData &data)
m_ui->authorLineEdit->setText(data.author);
- if (data.includeHints.empty()) {
+ if (data.includeHints.isEmpty()) {
m_ui->includeHintsTextEdit->clear();
} else {
m_ui->includeHintsTextEdit->setText(data.includeHints.join(QLatin1Char('\n')));
diff --git a/src/designer/src/components/formeditor/layout_propertysheet.cpp b/src/designer/src/components/formeditor/layout_propertysheet.cpp
index e0e456d32..0bb3ecb2f 100644
--- a/src/designer/src/components/formeditor/layout_propertysheet.cpp
+++ b/src/designer/src/components/formeditor/layout_propertysheet.cpp
@@ -103,7 +103,7 @@ static bool isIntegerList(const QString &s)
static LayoutPropertyType layoutPropertyType(const QString &name)
{
static QHash<QString, LayoutPropertyType> namePropertyMap;
- if (namePropertyMap.empty()) {
+ if (namePropertyMap.isEmpty()) {
namePropertyMap.insert(QLatin1String(leftMargin), LayoutPropertyLeftMargin);
namePropertyMap.insert(QLatin1String(topMargin), LayoutPropertyTopMargin);
namePropertyMap.insert(QLatin1String(rightMargin), LayoutPropertyRightMargin);
diff --git a/src/designer/src/components/formeditor/previewactiongroup.cpp b/src/designer/src/components/formeditor/previewactiongroup.cpp
index 89c3a0ae7..e0f3b7db1 100644
--- a/src/designer/src/components/formeditor/previewactiongroup.cpp
+++ b/src/designer/src/components/formeditor/previewactiongroup.cpp
@@ -98,7 +98,7 @@ void PreviewActionGroup::updateDeviceProfiles()
const DeviceProfileList profiles = settings.deviceProfiles();
const ActionList al = actions();
// Separator?
- const bool hasProfiles = !profiles.empty();
+ const bool hasProfiles = !profiles.isEmpty();
al.at(MaxDeviceActions)->setVisible(hasProfiles);
int index = 0;
if (hasProfiles) {
diff --git a/src/designer/src/components/formeditor/qdesigner_resource.cpp b/src/designer/src/components/formeditor/qdesigner_resource.cpp
index dd1144d7c..ff4a42744 100644
--- a/src/designer/src/components/formeditor/qdesigner_resource.cpp
+++ b/src/designer/src/components/formeditor/qdesigner_resource.cpp
@@ -516,14 +516,14 @@ void QDesignerResource::saveDom(DomUI *ui, QWidget *widget)
ui->setAttributeConnectslotsbyname(false);
const QVariantMap designerFormData = m_formWindow->formData();
- if (!designerFormData.empty()) {
+ if (!designerFormData.isEmpty()) {
DomPropertyList domPropertyList;
const QVariantMap::const_iterator cend = designerFormData.constEnd();
for (QVariantMap::const_iterator it = designerFormData.constBegin(); it != cend; ++it) {
if (DomProperty *prop = variantToDomProperty(this, widget->metaObject(), it.key(), it.value()))
domPropertyList += prop;
}
- if (!domPropertyList.empty()) {
+ if (!domPropertyList.isEmpty()) {
DomDesignerData* domDesignerFormData = new DomDesignerData;
domDesignerFormData->setElementProperty(domPropertyList);
ui->setElementDesignerdata(domDesignerFormData);
@@ -590,7 +590,7 @@ void QDesignerResource::saveDom(DomUI *ui, QWidget *widget)
const MetaDataBaseItem *item = metaDataBase->metaDataBaseItem(m_formWindow->mainContainer());
const QStringList fakeSlots = item->fakeSlots();
const QStringList fakeSignals =item->fakeSignals();
- if (!fakeSlots.empty() || !fakeSignals.empty()) {
+ if (!fakeSlots.isEmpty() || !fakeSignals.isEmpty()) {
DomSlots *domSlots = new DomSlots();
domSlots->setElementSlot(fakeSlots);
domSlots->setElementSignal(fakeSignals);
@@ -708,7 +708,7 @@ QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget)
// Register all button groups the form builder adds as children of the main container for them to be found
// in the signal slot editor
const QObjectList mchildren = mainWidget->children();
- if (!mchildren.empty()) {
+ if (!mchildren.isEmpty()) {
QDesignerMetaDataBaseInterface *mdb = core()->metaDataBase();
const QObjectList::const_iterator cend = mchildren.constEnd();
for (QObjectList::const_iterator it = mchildren.constBegin(); it != cend; ++it)
@@ -740,7 +740,7 @@ QWidget *QDesignerResource::create(DomUI *ui, QWidget *parentWidget)
// Initialize the mainwindow geometry. Has it been explicitly specified?
bool hasExplicitGeometry = false;
const auto &properties = ui->elementWidget()->elementProperty();
- if (!properties.empty()) {
+ if (!properties.isEmpty()) {
const QString geometry = QStringLiteral("geometry");
for (const DomProperty *p : properties) {
if (p->attributeName() == geometry) {
@@ -941,7 +941,7 @@ static bool readDomEnumerationValue(const DomProperty *p,
void QDesignerResource::applyProperties(QObject *o, const QList<DomProperty*> &properties)
{
- if (properties.empty())
+ if (properties.isEmpty())
return;
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), o);
@@ -1692,7 +1692,7 @@ DomUI *QDesignerResource::copy(const FormBuilderClipboard &selection)
ui_widget->setAttributeName(QLatin1String(clipboardObjectName));
bool hasItems = false;
// Widgets
- if (!selection.m_widgets.empty()) {
+ if (!selection.m_widgets.isEmpty()) {
QVector<DomWidget *> ui_widget_list;
const int size = selection.m_widgets.size();
for (int i=0; i< size; ++i) {
@@ -1703,19 +1703,19 @@ DomUI *QDesignerResource::copy(const FormBuilderClipboard &selection)
if (ui_child)
ui_widget_list.append(ui_child);
}
- if (!ui_widget_list.empty()) {
+ if (!ui_widget_list.isEmpty()) {
ui_widget->setElementWidget(ui_widget_list);
hasItems = true;
}
}
// actions
- if (!selection.m_actions.empty()) {
+ if (!selection.m_actions.isEmpty()) {
QVector<DomAction *> domActions;
for (QAction* action : qAsConst(selection.m_actions)) {
if (DomAction *domAction = createDom(action))
domActions += domAction;
}
- if (!domActions.empty()) {
+ if (!domActions.isEmpty()) {
ui_widget-> setElementAction(domActions);
hasItems = true;
}
@@ -1750,7 +1750,7 @@ FormBuilderClipboard QDesignerResource::paste(DomUI *ui, QWidget *widgetParent,
const DomWidget *topLevel = ui->elementWidget();
initialize(ui);
const auto &domWidgets = topLevel->elementWidget();
- if (!domWidgets.empty()) {
+ if (!domWidgets.isEmpty()) {
const QPoint offset = m_formWindow->grid();
for (DomWidget* domWidget : domWidgets) {
if (QWidget *w = create(domWidget, widgetParent)) {
@@ -1857,7 +1857,7 @@ DomCustomWidgets *QDesignerResource::saveCustomWidgets()
WidgetDataBaseItem *internalItem = static_cast<WidgetDataBaseItem *>(item);
const QStringList fakeSlots = internalItem->fakeSlots();
const QStringList fakeSignals = internalItem->fakeSignals();
- if (!fakeSlots.empty() || !fakeSignals.empty()) {
+ if (!fakeSlots.isEmpty() || !fakeSignals.isEmpty()) {
DomSlots *domSlots = new DomSlots();
domSlots->setElementSlot(fakeSlots);
domSlots->setElementSignal(fakeSignals);
@@ -2212,7 +2212,7 @@ QActionGroup *QDesignerResource::createActionGroup(QObject *parent, const QStrin
void QDesignerResource::applyAttributesToPropertySheet(const DomWidget *ui_widget, QWidget *widget)
{
const DomPropertyList attributes = ui_widget->elementAttribute();
- if (attributes.empty())
+ if (attributes.isEmpty())
return;
QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(m_formWindow->core()->extensionManager(), widget);
const DomPropertyList::const_iterator acend = attributes.constEnd();
diff --git a/src/designer/src/components/formeditor/qmdiarea_container.cpp b/src/designer/src/components/formeditor/qmdiarea_container.cpp
index e33c99367..e1930501f 100644
--- a/src/designer/src/components/formeditor/qmdiarea_container.cpp
+++ b/src/designer/src/components/formeditor/qmdiarea_container.cpp
@@ -144,7 +144,7 @@ QMdiAreaPropertySheet::MdiAreaProperty QMdiAreaPropertySheet::mdiAreaProperty(co
{
using MdiAreaPropertyHash = QHash<QString, MdiAreaProperty>;
static MdiAreaPropertyHash mdiAreaPropertyHash;
- if (mdiAreaPropertyHash.empty()) {
+ if (mdiAreaPropertyHash.isEmpty()) {
mdiAreaPropertyHash.insert(QLatin1String(subWindowNameC), MdiAreaSubWindowName);
mdiAreaPropertyHash.insert(QLatin1String(subWindowTitleC), MdiAreaSubWindowTitle);
}
diff --git a/src/designer/src/components/formeditor/qwizard_container.cpp b/src/designer/src/components/formeditor/qwizard_container.cpp
index dbc7084eb..5853fbf98 100644
--- a/src/designer/src/components/formeditor/qwizard_container.cpp
+++ b/src/designer/src/components/formeditor/qwizard_container.cpp
@@ -65,15 +65,12 @@ QWidget *QWizardContainer::widget(int index) const
int QWizardContainer::currentIndex() const
{
- const IdList idList = m_wizard->pageIds();
- const int currentId = m_wizard->currentId();
- const int rc = idList.empty() ? -1 : idList.indexOf(currentId);
- return rc;
+ return m_wizard->pageIds().indexOf(m_wizard->currentId());
}
void QWizardContainer::setCurrentIndex(int index)
{
- if (index < 0 || m_wizard->pageIds().empty())
+ if (index < 0 || m_wizard->pageIds().isEmpty())
return;
int currentIdx = currentIndex();
diff --git a/src/designer/src/components/formeditor/templateoptionspage.cpp b/src/designer/src/components/formeditor/templateoptionspage.cpp
index b1c0dc2d4..e50260406 100644
--- a/src/designer/src/components/formeditor/templateoptionspage.cpp
+++ b/src/designer/src/components/formeditor/templateoptionspage.cpp
@@ -79,7 +79,7 @@ void TemplateOptionsWidget::setTemplatePaths(const QStringList &l)
{
// add paths and select 0
m_ui->m_templatePathListWidget->clear();
- if (l.empty()) {
+ if (l.isEmpty()) {
// disable button
templatePathSelectionChanged();
} else {
@@ -98,7 +98,7 @@ void TemplateOptionsWidget::addTemplatePath()
const QList<QListWidgetItem *> existing
= m_ui->m_templatePathListWidget->findItems(templatePath, Qt::MatchExactly);
- if (!existing.empty())
+ if (!existing.isEmpty())
return;
QListWidgetItem *newItem = new QListWidgetItem(templatePath);
@@ -110,15 +110,15 @@ void TemplateOptionsWidget::removeTemplatePath()
{
const QList<QListWidgetItem *> selectedPaths
= m_ui->m_templatePathListWidget->selectedItems();
- if (selectedPaths.empty())
+ if (selectedPaths.isEmpty())
return;
- delete selectedPaths.front();
+ delete selectedPaths.constFirst();
}
void TemplateOptionsWidget::templatePathSelectionChanged()
{
const QList<QListWidgetItem *> selectedPaths = m_ui->m_templatePathListWidget->selectedItems();
- m_ui->m_removeTemplatePathButton->setEnabled(!selectedPaths.empty());
+ m_ui->m_removeTemplatePathButton->setEnabled(!selectedPaths.isEmpty());
}
QString TemplateOptionsWidget::chooseTemplatePath(QDesignerFormEditorInterface *core, QWidget *parent)
diff --git a/src/designer/src/components/objectinspector/objectinspector.cpp b/src/designer/src/components/objectinspector/objectinspector.cpp
index 4267fea22..248041811 100644
--- a/src/designer/src/components/objectinspector/objectinspector.cpp
+++ b/src/designer/src/components/objectinspector/objectinspector.cpp
@@ -424,7 +424,7 @@ bool ObjectInspector::ObjectInspectorPrivate::selectObject(QObject *o)
using ModelIndexSet = QSet<QModelIndex>;
const QModelIndexList objectIndexes = indexesOf(o);
- if (objectIndexes.empty())
+ if (objectIndexes.isEmpty())
return false;
QItemSelectionModel *selectionModel = m_treeView->selectionModel();
@@ -432,8 +432,10 @@ bool ObjectInspector::ObjectInspectorPrivate::selectObject(QObject *o)
const ModelIndexSet currentSelectedItems(currentSelectedItemList.cbegin(), currentSelectedItemList.cend());
// Change in selection?
- if (!currentSelectedItems.empty() && currentSelectedItems == ModelIndexSet(objectIndexes.cbegin(), objectIndexes.cend()))
+ if (!currentSelectedItems.isEmpty()
+ && currentSelectedItems == ModelIndexSet(objectIndexes.cbegin(), objectIndexes.cend())) {
return true;
+ }
// do select and update
selectIndexRange(objectIndexes, MakeCurrent);
@@ -442,7 +444,7 @@ bool ObjectInspector::ObjectInspectorPrivate::selectObject(QObject *o)
void ObjectInspector::ObjectInspectorPrivate::selectIndexRange(const QModelIndexList &indexes, unsigned flags)
{
- if (indexes.empty())
+ if (indexes.isEmpty())
return;
QItemSelectionModel::SelectionFlags selectFlags = QItemSelectionModel::Select|QItemSelectionModel::Rows;
@@ -459,7 +461,7 @@ void ObjectInspector::ObjectInspectorPrivate::selectIndexRange(const QModelIndex
selectFlags &= ~(QItemSelectionModel::Clear|QItemSelectionModel::Current);
}
if (flags & MakeCurrent)
- m_treeView->scrollTo(indexes.front(), QAbstractItemView::EnsureVisible);
+ m_treeView->scrollTo(indexes.constFirst(), QAbstractItemView::EnsureVisible);
}
void ObjectInspector::ObjectInspectorPrivate::clear()
@@ -528,10 +530,10 @@ void ObjectInspector::ObjectInspectorPrivate::setFormWindowBlocked(QDesignerForm
bool applySelection = !mainContainerIsCurrent(m_formWindow);
if (!applySelection) {
const QModelIndexList currentIndexes = m_treeView->selectionModel()->selectedRows(0);
- if (currentIndexes.empty()) {
+ if (currentIndexes.isEmpty()) {
applySelection = true;
} else {
- applySelection = selectionType(m_formWindow, objectAt(currentIndexes.front())) == ManagedWidgetSelection;
+ applySelection = selectionType(m_formWindow, objectAt(currentIndexes.constFirst())) == ManagedWidgetSelection;
}
}
if (applySelection)
@@ -590,7 +592,7 @@ void ObjectInspector::ObjectInspectorPrivate::slotSelectionChanged(const QItemSe
// some index lists are multicolumn ranges
QObjectVector ObjectInspector::ObjectInspectorPrivate::indexesToObjects(const QModelIndexList &indexes) const
{
- if (indexes.empty())
+ if (indexes.isEmpty())
return QObjectVector();
QObjectVector rc;
rc.reserve(indexes.size());
@@ -638,11 +640,11 @@ void ObjectInspector::ObjectInspectorPrivate::synchronizeSelection(const QItemSe
const QModelIndexList currentSelectedIndexes = m_treeView->selectionModel()->selectedRows(0);
int deselectedManagedWidgetCount = 0;
- if (!deselected.empty())
+ if (!deselected.isEmpty())
deselectedManagedWidgetCount = selectInCursor(m_formWindow, deselected, false);
- if (newlySelected.empty()) { // Nothing selected
- if (currentSelectedIndexes.empty()) // Do not allow a null-selection, reset to main container
+ if (newlySelected.isEmpty()) { // Nothing selected
+ if (currentSelectedIndexes.isEmpty()) // Do not allow a null-selection, reset to main container
m_formWindow->clearSelection(!m_withinClearSelection);
return;
}
@@ -660,7 +662,7 @@ void ObjectInspector::ObjectInspectorPrivate::synchronizeSelection(const QItemSe
}
// And now for the unmanaged selection
m_formWindow->clearSelection(false);
- QObject *unmanagedObject = newlySelected.front();
+ QObject *unmanagedObject = newlySelected.constFirst();
m_core->propertyEditor()->setObject(unmanagedObject);
m_core->propertyEditor()->setEnabled(true);
// open container page if it is a single widget
@@ -670,7 +672,7 @@ void ObjectInspector::ObjectInspectorPrivate::synchronizeSelection(const QItemSe
}
// Open container page if it is a single widget
if (newlySelected.size() == 1) {
- QObject *object = newlySelected.back();
+ QObject *object = newlySelected.constFirst();
if (object->isWidgetType())
showContainersCurrentPage(static_cast<QWidget*>(object));
}
@@ -693,7 +695,7 @@ void ObjectInspector::ObjectInspectorPrivate::getSelection(Selection &s) const
return;
const QModelIndexList currentSelectedIndexes = m_treeView->selectionModel()->selectedRows(0);
- if (currentSelectedIndexes.empty())
+ if (currentSelectedIndexes.isEmpty())
return;
// sort objects
diff --git a/src/designer/src/components/objectinspector/objectinspectormodel.cpp b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
index 6baf4bcdc..b980d3967 100644
--- a/src/designer/src/components/objectinspector/objectinspectormodel.cpp
+++ b/src/designer/src/components/objectinspector/objectinspectormodel.cpp
@@ -290,7 +290,7 @@ namespace qdesigner_internal {
}
QObjectList children = object->children();
- if (!children.empty()) {
+ if (!children.isEmpty()) {
ButtonGroupList buttonGroups;
std::sort(children.begin(), children.end(), sortEntry);
const QObjectList::const_iterator cend = children.constEnd();
@@ -310,7 +310,7 @@ namespace qdesigner_internal {
}
}
// Add button groups
- if (!buttonGroups.empty()) {
+ 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);
@@ -319,7 +319,7 @@ namespace qdesigner_internal {
if (object->isWidgetType()) {
// Add actions
const ActionList actions = static_cast<QWidget*>(object)->actions();
- if (!actions.empty()) {
+ 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)) {
@@ -415,7 +415,7 @@ namespace qdesigner_internal {
void ObjectInspectorModel::rebuild(const ObjectModel &newModel)
{
clearItems();
- if (newModel.empty())
+ if (newModel.isEmpty())
return;
const ObjectModel::const_iterator mcend = newModel.constEnd();
@@ -424,7 +424,7 @@ namespace qdesigner_internal {
StandardItemList rootRow = createModelRow(it->object());
it->setItems(rootRow, m_icons);
appendRow(rootRow);
- m_objectIndexMultiMap.insert(it->object(), indexFromItem(rootRow.front()));
+ m_objectIndexMultiMap.insert(it->object(), indexFromItem(rootRow.constFirst()));
for (++it; it != mcend; ++it) {
// Add to parent item, found via map
const QModelIndex parentIndex = m_objectIndexMultiMap.value(it->parent(), QModelIndex());
@@ -433,7 +433,7 @@ namespace qdesigner_internal {
StandardItemList row = createModelRow(it->object());
it->setItems(row, m_icons);
parentItem->appendRow(row);
- m_objectIndexMultiMap.insert(it->object(), indexFromItem(row.front()));
+ m_objectIndexMultiMap.insert(it->object(), indexFromItem(row.constFirst()));
}
}
diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
index 2f1a65940..ad1b6505c 100644
--- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
+++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp
@@ -2272,7 +2272,7 @@ void DesignerEditorFactory::disconnectPropertyManager(QtVariantPropertyManager *
template <class EditorContainer, class Editor, class SetterParameter, class Value>
static inline void applyToEditors(const EditorContainer &list, void (Editor::*setter)(SetterParameter), const Value &value)
{
- if (list.empty()) {
+ if (list.isEmpty()) {
return;
}
for (auto it = list.constBegin(), end = list.constEnd(); it != end; ++it) {
@@ -2659,7 +2659,7 @@ void DesignerEditorFactory::slotStringTextChanged(const QString &value)
PropertySheetStringValue strVal = qvariant_cast<PropertySheetStringValue>(val);
strVal.setValue(value);
// Disable translation if no translation subproperties exist.
- if (varProp->subProperties().empty())
+ if (varProp->subProperties().isEmpty())
strVal.setTranslatable(false);
val = QVariant::fromValue(strVal);
} else {
@@ -2725,7 +2725,7 @@ void DesignerEditorFactory::slotStringListChanged(const QStringList &value)
PropertySheetStringListValue listValue = qvariant_cast<PropertySheetStringListValue>(val);
listValue.setValue(value);
// Disable translation if no translation subproperties exist.
- if (varProp->subProperties().empty())
+ if (varProp->subProperties().isEmpty())
listValue.setTranslatable(false);
val = QVariant::fromValue(listValue);
} else {
diff --git a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp
index a29867011..b34b288a5 100644
--- a/src/designer/src/components/propertyeditor/fontpropertymanager.cpp
+++ b/src/designer/src/components/propertyeditor/fontpropertymanager.cpp
@@ -86,7 +86,7 @@ namespace qdesigner_internal {
// Map the font family names to display names retrieved from the XML configuration
static QStringList designerFamilyNames(QStringList families, const FontPropertyManager::NameMap &nm)
{
- if (nm.empty())
+ if (nm.isEmpty())
return families;
const auto ncend = nm.constEnd();
@@ -117,9 +117,9 @@ namespace qdesigner_internal {
m_propertyToAntialiasing[property] = antialiasing;
m_antialiasingToProperty[antialiasing] = property;
// Fiddle family names
- if (!m_familyMappings.empty()) {
+ if (!m_familyMappings.isEmpty()) {
const PropertyToSubPropertiesMap::iterator it = m_propertyToFontSubProperties.find(m_createdFontProperty);
- QtVariantProperty *familyProperty = vm->variantProperty(it.value().front());
+ QtVariantProperty *familyProperty = vm->variantProperty(it.value().constFirst());
const QString enumNamesAttribute = QStringLiteral("enumNames");
QStringList plainFamilyNames = familyProperty->attributeValue(enumNamesAttribute).toStringList();
// Did someone load fonts or something?
diff --git a/src/designer/src/components/propertyeditor/propertyeditor.cpp b/src/designer/src/components/propertyeditor/propertyeditor.cpp
index af590a7d5..85724eb01 100644
--- a/src/designer/src/components/propertyeditor/propertyeditor.cpp
+++ b/src/designer/src/components/propertyeditor/propertyeditor.cpp
@@ -363,7 +363,7 @@ PropertyEditor::PropertyEditor(QDesignerFormEditorInterface *core, QWidget *pare
break;
}
// Restore expansionState from QVariant map
- if (!expansionState.empty()) {
+ if (!expansionState.isEmpty()) {
const QVariantMap::const_iterator cend = expansionState.constEnd();
for (QVariantMap::const_iterator it = expansionState.constBegin(); it != cend; ++it)
m_expansionState.insert(it.key(), it.value().toBool());
@@ -386,7 +386,7 @@ void PropertyEditor::saveSettings() const
settings->setValue(QLatin1String(SortedKeyC), QVariant(m_sorting));
// Save last expansionState as QVariant map
QVariantMap expansionState;
- if (!m_expansionState.empty()) {
+ if (!m_expansionState.isEmpty()) {
const QMap<QString, bool>::const_iterator cend = m_expansionState.constEnd();
for (QMap<QString, bool>::const_iterator it = m_expansionState.constBegin(); it != cend; ++it)
expansionState.insert(it.key(), QVariant(it.value()));
@@ -436,7 +436,7 @@ void PropertyEditor::storePropertiesExpansionState(const QList<QtBrowserItem *>
{
const QChar bar = QLatin1Char('|');
for (QtBrowserItem *propertyItem : items) {
- if (!propertyItem->children().empty()) {
+ if (!propertyItem->children().isEmpty()) {
QtProperty *property = propertyItem->property();
const QString propertyName = property->propertyName();
const QMap<QtProperty *, QString>::const_iterator itGroup = m_propertyToGroup.constFind(property);
@@ -459,7 +459,7 @@ void PropertyEditor::storeExpansionState()
for (QtBrowserItem *item : items) {
const QString groupName = item->property()->propertyName();
QList<QtBrowserItem *> propertyItems = item->children();
- if (!propertyItems.empty())
+ if (!propertyItems.isEmpty())
m_expansionState[groupName] = isExpanded(item);
// properties stuff here
@@ -814,7 +814,7 @@ void PropertyEditor::updateBrowserValue(QtVariantProperty *property, const QVari
}
// Rich text string property with comment: Store/Update the font the rich text editor dialog starts out with
- if (type == QVariant::String && !property->subProperties().empty()) {
+ if (type == QVariant::String && !property->subProperties().isEmpty()) {
const int fontIndex = m_propertySheet->indexOf(m_strings.m_fontProperty);
if (fontIndex != -1)
property->setAttribute(m_strings.m_fontAttribute, m_propertySheet->property(fontIndex));
@@ -1093,8 +1093,8 @@ void PropertyEditor::setObject(QObject *object)
lastGroup = groupProperty;
lastProperty = nullptr; // Append at end
const QList<QtProperty*> subProperties = lastGroup->subProperties();
- if (!subProperties.empty())
- lastProperty = subProperties.back();
+ if (!subProperties.isEmpty())
+ lastProperty = subProperties.constLast();
lastGroup = groupProperty;
}
if (!m_groups.contains(groupProperty))
@@ -1123,7 +1123,7 @@ void PropertyEditor::setObject(QObject *object)
QMap<QString, QtVariantProperty *> groups = m_nameToGroup;
for (auto itGroup = groups.cbegin(), end = groups.cend(); itGroup != end; ++itGroup) {
QtVariantProperty *groupProperty = itGroup.value();
- if (groupProperty->subProperties().empty()) {
+ if (groupProperty->subProperties().isEmpty()) {
if (groupProperty == m_dynamicGroup)
m_dynamicGroup = nullptr;
delete groupProperty;
@@ -1247,7 +1247,7 @@ void PropertyEditor::editProperty(const QString &name)
if (QtVariantProperty *property = m_nameToProperty.value(name, 0)) {
const QList<QtBrowserItem *> items = m_currentBrowser->items(property);
if (items.size() == 1)
- browserItem = items.front();
+ browserItem = items.constFirst();
}
if (browserItem == nullptr)
return;
diff --git a/src/designer/src/components/signalsloteditor/connectdialog.cpp b/src/designer/src/components/signalsloteditor/connectdialog.cpp
index 571ddba12..6eef6dcc7 100644
--- a/src/designer/src/components/signalsloteditor/connectdialog.cpp
+++ b/src/designer/src/components/signalsloteditor/connectdialog.cpp
@@ -140,20 +140,20 @@ void ConnectDialog::setSignalSlot(const QString &signal, const QString &slot)
{
ListWidgetItems sigItems = m_ui.signalList->findItems(signal, Qt::MatchExactly);
- if (sigItems.empty()) {
+ if (sigItems.isEmpty()) {
m_ui.showAllCheckBox->setChecked(true);
sigItems = m_ui.signalList->findItems(signal, Qt::MatchExactly);
}
- if (!sigItems.empty()) {
- selectSignal(sigItems.front());
+ if (!sigItems.isEmpty()) {
+ selectSignal(sigItems.constFirst());
ListWidgetItems slotItems = m_ui.slotList->findItems(slot, Qt::MatchExactly);
- if (slotItems.empty()) {
+ if (slotItems.isEmpty()) {
m_ui.showAllCheckBox->setChecked(true);
slotItems = m_ui.slotList->findItems(slot, Qt::MatchExactly);
}
- if (!slotItems.empty())
- selectSlot(slotItems.front());
+ if (!slotItems.isEmpty())
+ selectSlot(slotItems.constFirst());
}
}
diff --git a/src/designer/src/components/signalsloteditor/signalslot_utils.cpp b/src/designer/src/components/signalsloteditor/signalslot_utils.cpp
index f913b5bdf..c7a960ef3 100644
--- a/src/designer/src/components/signalsloteditor/signalslot_utils.cpp
+++ b/src/designer/src/components/signalsloteditor/signalslot_utils.cpp
@@ -93,7 +93,7 @@ static void memberList(QDesignerFormEditorInterface *core,
const QString className = wdbItem->name();
const QStringList wdbFakeMethods = member_type == qdesigner_internal::SlotMember ? wdbItem->fakeSlots() : wdbItem->fakeSignals();
- if (!wdbFakeMethods.empty())
+ if (!wdbFakeMethods.isEmpty())
for (const QString &fakeMethod : wdbFakeMethods)
if (predicate(fakeMethod)) {
*it = ClassNameSignaturePair(className, fakeMethod);
@@ -106,7 +106,7 @@ static void memberList(QDesignerFormEditorInterface *core,
if (const qdesigner_internal::MetaDataBaseItem *mdbItem = metaDataBase->metaDataBaseItem(object)) {
const QStringList mdbFakeMethods = member_type == qdesigner_internal::SlotMember ? mdbItem->fakeSlots() : mdbItem->fakeSignals();
- if (!mdbFakeMethods.empty())
+ if (!mdbFakeMethods.isEmpty())
for (const QString &fakeMethod : mdbFakeMethods)
if (predicate(fakeMethod)) {
*it = ClassNameSignaturePair(className, fakeMethod);
@@ -266,7 +266,7 @@ namespace qdesigner_internal {
{
QMap<QString, QString> rc;
memberList(core, object, type, true, EqualsPredicate(signature), SignatureIterator(&rc));
- return !rc.empty();
+ return !rc.isEmpty();
}
// ### deprecated
diff --git a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
index c2f53a46e..175b4f6a8 100644
--- a/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
+++ b/src/designer/src/components/signalsloteditor/signalsloteditorwindow.cpp
@@ -105,7 +105,7 @@ static QStringList objectNameList(QDesignerFormWindowInterface *form)
// Add managed actions and actions with managed menus
const ActionList actions = mainContainer->findChildren<QAction*>();
- if (!actions.empty()) {
+ if (!actions.isEmpty()) {
const ActionList::const_iterator cend = actions.constEnd();
for (ActionList::const_iterator it = actions.constBegin(); it != cend; ++it) {
QAction *a = *it;
@@ -123,7 +123,7 @@ static QStringList objectNameList(QDesignerFormWindowInterface *form)
// Add managed buttons groups
const ButtonGroupList buttonGroups = mainContainer->findChildren<QButtonGroup *>();
- if (!buttonGroups.empty()) {
+ if (!buttonGroups.isEmpty()) {
const ButtonGroupList::const_iterator cend = buttonGroups.constEnd();
for (ButtonGroupList::const_iterator it = buttonGroups.constBegin(); it != cend; ++it)
if (mdb->item(*it))
diff --git a/src/designer/src/components/taskmenu/button_taskmenu.cpp b/src/designer/src/components/taskmenu/button_taskmenu.cpp
index 5791c6991..80e9d45c3 100644
--- a/src/designer/src/components/taskmenu/button_taskmenu.cpp
+++ b/src/designer/src/components/taskmenu/button_taskmenu.cpp
@@ -211,7 +211,7 @@ CreateButtonGroupCommand::CreateButtonGroupCommand(QDesignerFormWindowInterface
bool CreateButtonGroupCommand::init(const ButtonList &bl)
{
- if (bl.empty())
+ if (bl.isEmpty())
return false;
QDesignerFormWindowInterface *fw = formWindow();
QButtonGroup *buttonGroup = new QButtonGroup(fw->mainContainer());
@@ -286,9 +286,9 @@ RemoveButtonsFromGroupCommand::RemoveButtonsFromGroupCommand(QDesignerFormWindow
bool RemoveButtonsFromGroupCommand::init(const ButtonList &bl)
{
- if (bl.empty())
+ if (bl.isEmpty())
return false;
- QButtonGroup *group = bl.front()->group();
+ QButtonGroup *group = bl.constFirst()->group();
if (!group)
return false;
if (bl.size() >= group->buttons().size())
@@ -560,7 +560,7 @@ static ButtonList buttonList(const QDesignerFormWindowCursorInterface *cursor)
static QUndoCommand *createRemoveButtonsCommand(QDesignerFormWindowInterface *fw, const ButtonList &bl)
{
- QButtonGroup *bg = bl.front()->group();
+ QButtonGroup *bg = bl.constFirst()->group();
// Complete group or 1-member group?
if (bl.size() >= bg->buttons().size() - 1) {
BreakButtonGroupCommand *breakCmd = new BreakButtonGroupCommand(fw);
@@ -588,7 +588,7 @@ void ButtonTaskMenu::createGroup()
const ButtonList bl = buttonList(fw->cursor());
// Do we need to remove the buttons from an existing group?
QUndoCommand *removeCmd = nullptr;
- if (bl.front()->group()) {
+ if (bl.constFirst()->group()) {
removeCmd = createRemoveButtonsCommand(fw, bl);
if (!removeCmd)
return;
@@ -651,7 +651,7 @@ void ButtonTaskMenu::addToGroup(QAction *a)
const ButtonList bl = buttonList(fw->cursor());
// Do we need to remove the buttons from an existing group?
QUndoCommand *removeCmd = nullptr;
- if (bl.front()->group()) {
+ if (bl.constFirst()->group()) {
removeCmd = createRemoveButtonsCommand(fw, bl);
if (!removeCmd)
return;
diff --git a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp
index 30fbc2337..c44fa4169 100644
--- a/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp
+++ b/src/designer/src/components/widgetbox/widgetbox_dnditem.cpp
@@ -174,7 +174,7 @@ static QWidget *decorationFromDomWidget(DomUI *dom_ui, QDesignerFormEditorInterf
QWidget *fakeTopLevel = builder.createUI(dom_ui, nullptr);
fakeTopLevel->setParent(nullptr, Qt::ToolTip); // Container
// Actual widget
- const DomWidget *domW = dom_ui->elementWidget()->elementWidget().front();
+ const DomWidget *domW = dom_ui->elementWidget()->elementWidget().constFirst();
QWidget *w = fakeTopLevel->findChildren<QWidget*>().constFirst();
Q_ASSERT(w);
// hack begin;
diff --git a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
index dd17b3a4e..a170fa7c7 100644
--- a/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
+++ b/src/designer/src/components/widgetbox/widgetboxtreewidget.cpp
@@ -160,7 +160,7 @@ void WidgetBoxTreeWidget::restoreExpandedState()
const auto &closedCategoryList = settings->value(groupKey + QLatin1String(widgetBoxExpandedKeyC), QStringList()).toStringList();
const StringSet closedCategories(closedCategoryList.cbegin(), closedCategoryList.cend());
expandAll();
- if (closedCategories.empty())
+ if (closedCategories.isEmpty())
return;
if (const int numCategories = categoryCount()) {
@@ -594,8 +594,7 @@ static inline bool isValidIcon(const QIcon &icon)
{
if (!icon.isNull()) {
const QList<QSize> availableSizes = icon.availableSizes();
- if (!availableSizes.empty())
- return !availableSizes.front().isEmpty();
+ return !availableSizes.isEmpty() && !availableSizes.constFirst().isEmpty();
}
return false;
}
@@ -606,7 +605,7 @@ WidgetBoxTreeWidget::CategoryList WidgetBoxTreeWidget::loadCustomCategoryList()
const QDesignerPluginManager *pm = m_core->pluginManager();
const QDesignerPluginManager::CustomWidgetList customWidgets = pm->registeredCustomWidgets();
- if (customWidgets.empty())
+ if (customWidgets.isEmpty())
return result;
static const QString customCatName = tr("Custom Widgets");
diff --git a/src/designer/src/designer/appfontdialog.cpp b/src/designer/src/designer/appfontdialog.cpp
index b1a3942df..c5524be7f 100644
--- a/src/designer/src/designer/appfontdialog.cpp
+++ b/src/designer/src/designer/appfontdialog.cpp
@@ -122,7 +122,7 @@ void AppFontManager::restore(const QDesignerSettingsInterface *s, const QString
if (debugAppFontWidget)
qDebug() << "AppFontManager::restoring" << fontFiles.size() << "fonts from " << prefix;
- if (!fontFiles.empty()) {
+ if (!fontFiles.isEmpty()) {
QString errorMessage;
const QStringList::const_iterator cend = fontFiles.constEnd();
for (QStringList::const_iterator it = fontFiles.constBegin(); it != cend; ++it)
@@ -311,7 +311,7 @@ void AppFontWidget::addFiles()
const QStringList files =
QFileDialog::getOpenFileNames(this, tr("Add Font Files"), QString(),
tr("Font files (*.ttf)"));
- if (files.empty())
+ if (files.isEmpty())
return;
QString errorMessage;
@@ -331,7 +331,7 @@ void AppFontWidget::addFiles()
static void removeFonts(const QModelIndexList &selectedIndexes, AppFontModel *model, QWidget *dialogParent)
{
- if (selectedIndexes.empty())
+ if (selectedIndexes.isEmpty())
return;
// Reverse sort top level rows and remove
@@ -382,7 +382,7 @@ void AppFontWidget::slotRemoveAll()
void AppFontWidget::selectionChanged(const QItemSelection &selected, const QItemSelection & /*deselected*/)
{
- m_removeButton->setEnabled(!selected.indexes().empty());
+ m_removeButton->setEnabled(!selected.indexes().isEmpty());
}
void AppFontWidget::save(QDesignerSettingsInterface *s, const QString &prefix)
diff --git a/src/designer/src/designer/mainwindow.cpp b/src/designer/src/designer/mainwindow.cpp
index 3a1ae3ce9..d47be9ad0 100644
--- a/src/designer/src/designer/mainwindow.cpp
+++ b/src/designer/src/designer/mainwindow.cpp
@@ -151,7 +151,7 @@ QStringList DockedMdiArea::uiFiles(const QMimeData *d) const
if (!d->hasFormat(QLatin1String(uriListMimeFormatC)))
return rc;
const QList<QUrl> urls = d->urls();
- if (urls.empty())
+ if (urls.isEmpty())
return rc;
const QList<QUrl>::const_iterator cend = urls.constEnd();
for (QList<QUrl>::const_iterator it = urls.constBegin(); it != cend; ++it) {
@@ -169,7 +169,7 @@ bool DockedMdiArea::event(QEvent *event)
switch (event->type()) {
case QEvent::DragEnter: {
QDragEnterEvent *e = static_cast<QDragEnterEvent*>(event);
- if (!uiFiles(e->mimeData()).empty()) {
+ if (!uiFiles(e->mimeData()).isEmpty()) {
e->acceptProposedAction();
return true;
}
@@ -338,7 +338,7 @@ QMdiSubWindow *DockedMainWindow::createMdiSubWindow(QWidget *fw, Qt::WindowFlags
// designer menu actions
if (designerCloseActionShortCut == QKeySequence(QKeySequence::Close)) {
const ActionList systemMenuActions = rc->systemMenu()->actions();
- if (!systemMenuActions.empty()) {
+ if (!systemMenuActions.isEmpty()) {
const ActionList::const_iterator cend = systemMenuActions.constEnd();
for (ActionList::const_iterator it = systemMenuActions.constBegin(); it != cend; ++it) {
if ( (*it)->shortcut() == designerCloseActionShortCut) {
diff --git a/src/designer/src/designer/newform.cpp b/src/designer/src/designer/newform.cpp
index 797e60149..12553c393 100644
--- a/src/designer/src/designer/newform.cpp
+++ b/src/designer/src/designer/newform.cpp
@@ -104,7 +104,7 @@ QDialogButtonBox *NewForm::createButtonBox()
QMenu *recentFilesMenu = new QMenu(tr("&Recent Forms"), m_recentButton);
// Pop the "Recent Files" stuff in here.
const QList<QAction *> recentActions = da->recentFilesActions()->actions();
- if (!recentActions.empty()) {
+ if (!recentActions.isEmpty()) {
const QList<QAction *>::const_iterator acend = recentActions.constEnd();
for (QList<QAction *>::const_iterator it = recentActions.constBegin(); it != acend; ++it) {
recentFilesMenu->addAction(*it);
diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp
index ff244ec29..4344b1c07 100644
--- a/src/designer/src/designer/qdesigner.cpp
+++ b/src/designer/src/designer/qdesigner.cpp
@@ -252,7 +252,7 @@ QDesigner::ParseArgumentsResult QDesigner::parseCommandLineArguments()
m_suppressNewFormShow = m_workbench->readInBackup();
- if (!options.files.empty()) {
+ if (!options.files.isEmpty()) {
const QStringList::const_iterator cend = options.files.constEnd();
for (QStringList::const_iterator it = options.files.constBegin(); it != cend; ++it) {
// Ensure absolute paths for recent file list to be unique
diff --git a/src/designer/src/designer/qdesigner_workbench.cpp b/src/designer/src/designer/qdesigner_workbench.cpp
index 498b0a7d7..6262747dd 100644
--- a/src/designer/src/designer/qdesigner_workbench.cpp
+++ b/src/designer/src/designer/qdesigner_workbench.cpp
@@ -606,7 +606,7 @@ void QDesignerWorkbench::removeFormWindow(QDesignerFormWindow *formWindow)
m_windowMenu->removeAction(action);
}
- if (m_formWindows.empty()) {
+ if (m_formWindows.isEmpty()) {
m_actionManager->setWindowListSeparatorVisible(false);
// Show up new form dialog unless closing
if (loadOk && m_state == StateUp
@@ -1077,7 +1077,7 @@ void QDesignerWorkbench::restoreUISettings()
ToolWindowFontSettings fontSettings = QDesignerSettings(m_core).toolWindowFont();
const QFont &font = fontSettings.m_useFont ? fontSettings.m_font : qApp->font();
- if (font == m_toolWindows.front()->font())
+ if (font == m_toolWindows.constFirst()->font())
return;
for (QDesignerToolWindow *tw : qAsConst(m_toolWindows))
diff --git a/src/designer/src/lib/shared/actioneditor.cpp b/src/designer/src/lib/shared/actioneditor.cpp
index d41a28f94..2aeea2a74 100644
--- a/src/designer/src/lib/shared/actioneditor.cpp
+++ b/src/designer/src/lib/shared/actioneditor.cpp
@@ -325,7 +325,7 @@ void ActionEditor::setFormWindow(QDesignerFormWindowInterface *formWindow)
void ActionEditor::slotSelectionChanged(const QItemSelection& selected, const QItemSelection& /*deselected*/)
{
- const bool hasSelection = !selected.indexes().empty();
+ const bool hasSelection = !selected.indexes().isEmpty();
#if QT_CONFIG(clipboard)
m_actionCopy->setEnabled(hasSelection);
m_actionCut->setEnabled(hasSelection);
@@ -349,7 +349,7 @@ void ActionEditor::slotCurrentItemChanged(QAction *action)
QDesignerObjectInspector *oi = qobject_cast<QDesignerObjectInspector *>(core()->objectInspector());
- if (action->associatedWidgets().empty()) {
+ if (action->associatedWidgets().isEmpty()) {
// Special case: action not in object tree. Deselect all and set in property editor
fw->clearSelection(false);
if (oi)
@@ -620,8 +620,9 @@ void ActionEditor::deleteActions(QDesignerFormWindowInterface *fw, const ActionL
{
// We need a macro even in the case of single action because the commands might cause the
// scheduling of other commands (signal slots connections)
- const QString description = actions.size() == 1 ?
- tr("Remove action '%1'").arg(actions.front()->objectName()) : tr("Remove actions");
+ const QString description = actions.size() == 1
+ ? tr("Remove action '%1'").arg(actions.constFirst()->objectName())
+ : tr("Remove actions");
fw->beginCommand(description);
for (QAction *action : actions) {
RemoveActionCommand *cmd = new RemoveActionCommand(fw);
@@ -662,7 +663,7 @@ void ActionEditor::slotDelete()
return;
const ActionView::ActionList selection = m_actionView->selectedActions();
- if (selection.empty())
+ if (selection.isEmpty())
return;
deleteActions(fw, selection);
@@ -802,7 +803,7 @@ void ActionEditor::slotCopy()
return;
const ActionView::ActionList selection = m_actionView->selectedActions();
- if (selection.empty())
+ if (selection.isEmpty())
return;
copyActions(fw, selection);
@@ -815,7 +816,7 @@ void ActionEditor::slotCut()
return;
const ActionView::ActionList selection = m_actionView->selectedActions();
- if (selection.empty())
+ if (selection.isEmpty())
return;
copyActions(fw, selection);
@@ -844,7 +845,7 @@ void ActionEditor::slotContextMenuRequested(QContextMenuEvent *e, QAction *item)
// Associated Widgets
if (QAction *action = m_actionView->currentAction()) {
const QWidgetList associatedWidgets = ActionModel::associatedWidgets(action);
- if (!associatedWidgets.empty()) {
+ if (!associatedWidgets.isEmpty()) {
QMenu *associatedWidgetsSubMenu = menu.addMenu(tr("Used In"));
for (QWidget *w : associatedWidgets) {
associatedWidgetsSubMenu->addAction(w->objectName(),
diff --git a/src/designer/src/lib/shared/actionrepository.cpp b/src/designer/src/lib/shared/actionrepository.cpp
index de1d1dc3a..6162d02e2 100644
--- a/src/designer/src/lib/shared/actionrepository.cpp
+++ b/src/designer/src/lib/shared/actionrepository.cpp
@@ -107,7 +107,7 @@ void ActionModel::update(int row)
for (int i = 0; i < NumColumns; i++)
list += item(row, i);
- setItems(m_core, actionOfItem(list.front()), m_emptyIcon, list);
+ setItems(m_core, actionOfItem(list.constFirst()), m_emptyIcon, list);
}
void ActionModel::remove(int row)
@@ -132,7 +132,7 @@ QModelIndex ActionModel::addAction(QAction *action)
}
setItems(m_core, action, m_emptyIcon, items);
appendRow(items);
- return indexFromItem(items.front());
+ return indexFromItem(items.constFirst());
}
// Find the associated menus and toolbars, ignore toolbuttons
@@ -190,7 +190,7 @@ void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action,
item->setWhatsThis(firstTooltip);
// Used
const QWidgetList associatedDesignerWidgets = associatedWidgets(action);
- const bool used = !associatedDesignerWidgets.empty();
+ const bool used = !associatedDesignerWidgets.isEmpty();
item = sl[UsedColumn];
item->setCheckState(used ? Qt::Checked : Qt::Unchecked);
if (used) {
@@ -308,14 +308,14 @@ static void handleImageDropEvent(const QAbstractItemView *iv, QDropEvent *event,
void startActionDrag(QWidget *dragParent, ActionModel *model, const QModelIndexList &indexes, Qt::DropActions supportedActions)
{
- if (indexes.empty())
+ if (indexes.isEmpty())
return;
QDrag *drag = new QDrag(dragParent);
QMimeData *data = model->mimeData(indexes);
drag->setMimeData(data);
if (ActionRepositoryMimeData *actionMimeData = qobject_cast<ActionRepositoryMimeData *>(data))
- drag->setPixmap(ActionRepositoryMimeData::actionDragPixmap(actionMimeData->actionList().front()));
+ drag->setPixmap(ActionRepositoryMimeData::actionDragPixmap(actionMimeData->actionList().constFirst()));
drag->exec(supportedActions);
}
diff --git a/src/designer/src/lib/shared/connectionedit.cpp b/src/designer/src/lib/shared/connectionedit.cpp
index a55465440..8916c4e1c 100644
--- a/src/designer/src/lib/shared/connectionedit.cpp
+++ b/src/designer/src/lib/shared/connectionedit.cpp
@@ -1371,7 +1371,7 @@ static ConnectionEdit::ConnectionSet findConnectionsOf(const ConnectionEdit::Con
void ConnectionEdit::widgetRemoved(QWidget *widget)
{
// Remove all connections of that widget and its children.
- if (m_con_list.empty())
+ if (m_con_list.isEmpty())
return;
QWidgetList child_list = widget->findChildren<QWidget*>();
@@ -1388,7 +1388,7 @@ void ConnectionEdit::widgetRemoved(QWidget *widget)
void ConnectionEdit::objectRemoved(QObject *o)
{
// Remove all connections of that object and its children (in case of action groups).
- if (m_con_list.empty())
+ if (m_con_list.isEmpty())
return;
QObjectList child_list = o->children();
diff --git a/src/designer/src/lib/shared/dialoggui.cpp b/src/designer/src/lib/shared/dialoggui.cpp
index 8c537ab34..613a42143 100644
--- a/src/designer/src/lib/shared/dialoggui.cpp
+++ b/src/designer/src/lib/shared/dialoggui.cpp
@@ -211,13 +211,13 @@ QString DialogGui::getOpenImageFileName(QWidget *parent, const QString &caption,
return QString();
const QStringList selectedFiles = fileDialog.selectedFiles();
- if (selectedFiles.empty())
+ if (selectedFiles.isEmpty())
return QString();
if (selectedFilter)
*selectedFilter = fileDialog.selectedNameFilter();
- return selectedFiles.front();
+ return selectedFiles.constFirst();
#else
return getOpenFileName(parent, caption, dir, filter, selectedFilter, options);
#endif
@@ -232,7 +232,7 @@ QStringList DialogGui::getOpenImageFileNames(QWidget *parent, const QString &cap
return QStringList();
const QStringList selectedFiles = fileDialog.selectedFiles();
- if (!selectedFiles.empty() && selectedFilter)
+ if (!selectedFiles.isEmpty() && selectedFilter)
*selectedFilter = fileDialog.selectedNameFilter();
return selectedFiles;
diff --git a/src/designer/src/lib/shared/formlayoutmenu.cpp b/src/designer/src/lib/shared/formlayoutmenu.cpp
index 8d4bab6c7..48d6ee488 100644
--- a/src/designer/src/lib/shared/formlayoutmenu.cpp
+++ b/src/designer/src/lib/shared/formlayoutmenu.cpp
@@ -476,7 +476,7 @@ void FormLayoutMenu::populate(QWidget *w, QDesignerFormWindowInterface *fw, Acti
{
switch (LayoutInfo::managedLayoutType(fw->core(), w)) {
case LayoutInfo::Form:
- if (!actions.empty() && !actions.back()->isSeparator())
+ if (!actions.isEmpty() && !actions.constLast()->isSeparator())
actions.push_back(m_separator1);
actions.push_back(m_populateFormAction);
actions.push_back(m_separator2);
diff --git a/src/designer/src/lib/shared/formwindowbase.cpp b/src/designer/src/lib/shared/formwindowbase.cpp
index 8c35ea700..6814cd04f 100644
--- a/src/designer/src/lib/shared/formwindowbase.cpp
+++ b/src/designer/src/lib/shared/formwindowbase.cpp
@@ -446,7 +446,7 @@ void FormWindowBase::deleteWidgetList(const QWidgetList &widget_list)
// the signal slot editor are connected to widgetRemoved() and add their
// own commands (for example, to delete w's connections)
const QString description = widget_list.size() == 1 ?
- tr("Delete '%1'").arg(widget_list.front()->objectName()) : tr("Delete");
+ tr("Delete '%1'").arg(widget_list.constFirst()->objectName()) : tr("Delete");
commandHistory()->beginMacro(description);
for (QWidget *w : qAsConst(widget_list)) {
@@ -467,16 +467,16 @@ QMenu *FormWindowBase::createExtensionTaskMenu(QDesignerFormWindowInterface *fw,
if (const QDesignerTaskMenuExtension *extTaskMenu = qt_extension<QDesignerTaskMenuExtension*>(em, o))
actions += extTaskMenu->taskActions();
if (const QDesignerTaskMenuExtension *intTaskMenu = qobject_cast<QDesignerTaskMenuExtension *>(em->extension(o, QStringLiteral("QDesignerInternalTaskMenuExtension")))) {
- if (!actions.empty()) {
+ if (!actions.isEmpty()) {
QAction *a = new QAction(fw);
a->setSeparator(true);
actions.push_back(a);
}
actions += intTaskMenu->taskActions();
}
- if (actions.empty())
+ if (actions.isEmpty())
return nullptr;
- if (trailingSeparator && !actions.back()->isSeparator()) {
+ if (trailingSeparator && !actions.constLast()->isSeparator()) {
QAction *a = new QAction(fw);
a->setSeparator(true);
actions.push_back(a);
diff --git a/src/designer/src/lib/shared/layout.cpp b/src/designer/src/lib/shared/layout.cpp
index 436d5223b..f121f31d6 100644
--- a/src/designer/src/lib/shared/layout.cpp
+++ b/src/designer/src/lib/shared/layout.cpp
@@ -1143,7 +1143,7 @@ inline QRect expandGeometry(const QRect &rect)
template <class GridLikeLayout, int LayoutType, int GridMode>
QWidgetList GridLayout<GridLikeLayout, LayoutType, GridMode>::buildGrid(const QWidgetList &widgetList)
{
- if (widgetList.empty())
+ if (widgetList.isEmpty())
return QWidgetList();
// Pixel to cell conversion:
diff --git a/src/designer/src/lib/shared/layoutinfo.cpp b/src/designer/src/lib/shared/layoutinfo.cpp
index 30cfabfda..d4a3286d0 100644
--- a/src/designer/src/lib/shared/layoutinfo.cpp
+++ b/src/designer/src/lib/shared/layoutinfo.cpp
@@ -65,7 +65,7 @@ LayoutInfo::Type LayoutInfo::layoutType(const QDesignerFormEditorInterface *core
static const QHash<QString, LayoutInfo::Type> &layoutNameTypeMap()
{
static QHash<QString, LayoutInfo::Type> nameTypeMap;
- if (nameTypeMap.empty()) {
+ if (nameTypeMap.isEmpty()) {
nameTypeMap.insert(QStringLiteral("QVBoxLayout"), LayoutInfo::VBox);
nameTypeMap.insert(QStringLiteral("QHBoxLayout"), LayoutInfo::HBox);
nameTypeMap.insert(QStringLiteral("QGridLayout"), LayoutInfo::Grid);
@@ -178,7 +178,7 @@ LayoutInfo::Type LayoutInfo::laidoutWidgetType(const QDesignerFormEditorInterfac
// 3) Some child layout (see below comment about Q3GroupBox)
const QList<QLayout*> childLayouts = parentLayout->findChildren<QLayout*>();
- if (childLayouts.empty())
+ if (childLayouts.isEmpty())
return NoLayout;
const QList<QLayout*>::const_iterator lcend = childLayouts.constEnd();
for (QList<QLayout*>::const_iterator it = childLayouts.constBegin(); it != lcend; ++it) {
diff --git a/src/designer/src/lib/shared/morphmenu.cpp b/src/designer/src/lib/shared/morphmenu.cpp
index ee09dfafd..9f700bb22 100644
--- a/src/designer/src/lib/shared/morphmenu.cpp
+++ b/src/designer/src/lib/shared/morphmenu.cpp
@@ -228,7 +228,7 @@ QLabel *buddyLabelOf(QDesignerFormWindowInterface *fw, QWidget *w)
{
using LabelList = QList<QLabel *>;
const LabelList labelList = fw->findChildren<QLabel*>();
- if (labelList.empty())
+ if (labelList.isEmpty())
return nullptr;
const LabelList::const_iterator cend = labelList.constEnd();
for (LabelList::const_iterator it = labelList.constBegin(); it != cend; ++it )
@@ -586,7 +586,7 @@ bool MorphMenu::populateMenu(QWidget *w, QDesignerFormWindowInterface *fw)
return false;
const QStringList c = MorphWidgetCommand::candidateClasses(fw, w);
- if (c.empty())
+ if (c.isEmpty())
return false;
// Pull up
diff --git a/src/designer/src/lib/shared/newformwidget.cpp b/src/designer/src/lib/shared/newformwidget.cpp
index b3853ae21..32a65c7de 100644
--- a/src/designer/src/lib/shared/newformwidget.cpp
+++ b/src/designer/src/lib/shared/newformwidget.cpp
@@ -183,7 +183,7 @@ NewFormWidget::NewFormWidget(QDesignerFormEditorInterface *core, QWidget *parent
connect(m_ui->profileComboBox,
QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &NewFormWidget::slotDeviceProfileIndexChanged);
- if (m_deviceProfiles.empty()) {
+ if (m_deviceProfiles.isEmpty()) {
m_ui->profileComboBox->setEnabled(false);
} else {
const DeviceProfileList::const_iterator dcend = m_deviceProfiles.constEnd();
@@ -446,7 +446,7 @@ void NewFormWidget::loadFrom(const QString &path, bool resourceFile, const QStri
void NewFormWidget::loadFrom(const QString &title, const QStringList &nameList,
const QString &selectedItem, QTreeWidgetItem *&selectedItemFound)
{
- if (nameList.empty())
+ if (nameList.isEmpty())
return;
QTreeWidgetItem *root = new QTreeWidgetItem(m_ui->treeWidget);
root->setFlags(root->flags() & ~Qt::ItemIsSelectable);
diff --git a/src/designer/src/lib/shared/pluginmanager.cpp b/src/designer/src/lib/shared/pluginmanager.cpp
index ddc8cd611..8abe94c12 100644
--- a/src/designer/src/lib/shared/pluginmanager.cpp
+++ b/src/designer/src/lib/shared/pluginmanager.cpp
@@ -589,7 +589,7 @@ QStringList QDesignerPluginManager::findPlugins(const QString &path)
return QStringList();
const QFileInfoList infoList = dir.entryInfoList(QDir::Files);
- if (infoList.empty())
+ if (infoList.isEmpty())
return QStringList();
// Load symbolic links but make sure all file names are unique as not
@@ -738,7 +738,7 @@ void QDesignerPluginManager::ensureInitialized()
m_d->clearCustomWidgets();
// Add the static custom widgets
const QObjectList staticPluginObjects = QPluginLoader::staticInstances();
- if (!staticPluginObjects.empty()) {
+ if (!staticPluginObjects.isEmpty()) {
const QString staticPluginPath = QCoreApplication::applicationFilePath();
for (QObject *o : staticPluginObjects)
m_d->addCustomWidgets(o, staticPluginPath, designerLanguage);
diff --git a/src/designer/src/lib/shared/previewconfigurationwidget.cpp b/src/designer/src/lib/shared/previewconfigurationwidget.cpp
index f9ddb4b5e..6089f91a6 100644
--- a/src/designer/src/lib/shared/previewconfigurationwidget.cpp
+++ b/src/designer/src/lib/shared/previewconfigurationwidget.cpp
@@ -63,13 +63,13 @@ enum { SkinComboNoneIndex = 0 };
// find default skins (resources)
static const Skins &defaultSkins() {
static Skins rc;
- if (rc.empty()) {
+ if (rc.isEmpty()) {
const QString skinPath = QLatin1String(skinResourcePathC);
QString pattern = QStringLiteral("*.");
pattern += QLatin1String(skinExtensionC);
const QDir dir(skinPath, pattern);
const QFileInfoList list = dir.entryInfoList(QDir::Dirs|QDir::NoDotAndDotDot, QDir::Name);
- if (list.empty())
+ if (list.isEmpty())
return rc;
const QFileInfoList::const_iterator lcend = list.constEnd();
for (QFileInfoList::const_iterator it = list.constBegin(); it != lcend; ++it)
@@ -171,7 +171,7 @@ QStringList PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate::userS
void PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate::addUserSkins(const QStringList &files)
{
- if (files.empty())
+ if (files.isEmpty())
return;
const QStringList ::const_iterator fcend = files.constEnd();
for (QStringList::const_iterator it = files.constBegin(); it != fcend; ++it) {
@@ -281,7 +281,7 @@ int PreviewConfigurationWidget::PreviewConfigurationWidgetPrivate::browseSkin()
break;
// check: 1) name already there
- const QString directory = directories.front();
+ const QString directory = directories.constFirst();
const QString name = QFileInfo(directory).baseName();
const int existingIndex = m_ui.m_skinCombo->findText(name);
if (existingIndex != -1 && existingIndex != SkinComboNoneIndex && existingIndex != m_browseSkinIndex) {
diff --git a/src/designer/src/lib/shared/previewmanager.cpp b/src/designer/src/lib/shared/previewmanager.cpp
index 4649901f9..2fbe2e012 100644
--- a/src/designer/src/lib/shared/previewmanager.cpp
+++ b/src/designer/src/lib/shared/previewmanager.cpp
@@ -772,11 +772,11 @@ QWidget *PreviewManager::showPreview(const QDesignerFormWindowInterface *fw,
// If its the first one, position relative to form.
// 2nd, attempt to tile right (for comparing styles) or cascade
const QSize size = widget->size();
- const bool firstPreview = d->m_previews.empty();
+ const bool firstPreview = d->m_previews.isEmpty();
if (firstPreview) {
widget->move(fw->mapToGlobal(QPoint(Spacing, Spacing)));
} else {
- if (QWidget *lastPreview = d->m_previews.back().m_widget) {
+ if (QWidget *lastPreview = d->m_previews.constLast().m_widget) {
QDesktopWidget *desktop = qApp->desktop();
const QRect lastPreviewGeometry = lastPreview->frameGeometry();
const QRect availGeometry = desktop->availableGeometry(lastPreview);
@@ -798,7 +798,7 @@ QWidget *PreviewManager::showPreview(const QDesignerFormWindowInterface *fw,
QWidget *PreviewManager::raise(const QDesignerFormWindowInterface *fw, const PreviewConfiguration &pc)
{
using PreviewDataList = PreviewManagerPrivate::PreviewDataList;
- if (d->m_previews.empty())
+ if (d->m_previews.isEmpty())
return nullptr;
// find matching window
@@ -816,7 +816,7 @@ QWidget *PreviewManager::raise(const QDesignerFormWindowInterface *fw, const Pre
void PreviewManager::closeAllPreviews()
{
- if (!d->m_previews.empty()) {
+ if (!d->m_previews.isEmpty()) {
d->m_updateBlocked = true;
d->m_activePreview = nullptr;
for (auto it = d->m_previews.constBegin(), cend = d->m_previews.constEnd(); it != cend ;++it) {
@@ -843,7 +843,7 @@ void PreviewManager::updatePreviewClosed(QWidget *w)
++it;
}
}
- if (d->m_previews.empty())
+ if (d->m_previews.isEmpty())
emit lastPreviewClosed();
}
diff --git a/src/designer/src/lib/shared/promotionmodel.cpp b/src/designer/src/lib/shared/promotionmodel.cpp
index c2dd25523..37136ced6 100644
--- a/src/designer/src/lib/shared/promotionmodel.cpp
+++ b/src/designer/src/lib/shared/promotionmodel.cpp
@@ -129,7 +129,7 @@ namespace qdesigner_internal {
// Set the item index as user data on the item.
const PromotedClasses promotedClasses = m_core->promotion()->promotedClasses();
- if (promotedClasses.empty())
+ if (promotedClasses.isEmpty())
return;
const QSet<QString> usedPromotedClasses = m_core->promotion()->referencedPromotedClassNames();
@@ -143,7 +143,7 @@ namespace qdesigner_internal {
if (baseClass != it->baseItem) {
baseClass = it->baseItem;
const StandardItemList baseRow = baseModelRow(it->baseItem);
- baseItem = baseRow.front();
+ baseItem = baseRow.constFirst();
appendRow(baseRow);
}
Q_ASSERT(baseItem);
@@ -187,7 +187,7 @@ namespace qdesigner_internal {
QModelIndex PromotionModel::indexOfClass(const QString &className) const {
const StandardItemList matches = findItems (className, Qt::MatchFixedString|Qt::MatchCaseSensitive|Qt::MatchRecursive);
- return matches.empty() ? QModelIndex() : indexFromItem (matches.front());
+ return matches.isEmpty() ? QModelIndex() : indexFromItem (matches.constFirst());
}
} // namespace qdesigner_internal
diff --git a/src/designer/src/lib/shared/promotiontaskmenu.cpp b/src/designer/src/lib/shared/promotiontaskmenu.cpp
index bb5631d32..33554707a 100644
--- a/src/designer/src/lib/shared/promotiontaskmenu.cpp
+++ b/src/designer/src/lib/shared/promotiontaskmenu.cpp
@@ -111,7 +111,7 @@ void PromotionTaskMenu::setDemoteLabel(const QString &demoteLabel)
PromotionTaskMenu::PromotionState PromotionTaskMenu::createPromotionActions(QDesignerFormWindowInterface *formWindow)
{
// clear out old
- if (!m_promotionActions.empty()) {
+ if (!m_promotionActions.isEmpty()) {
qDeleteAll(m_promotionActions);
m_promotionActions.clear();
}
@@ -122,7 +122,7 @@ PromotionTaskMenu::PromotionState PromotionTaskMenu::createPromotionActions(QDe
// Check for a homogenous selection
const PromotionSelectionList promotionSelection = promotionSelectionList(formWindow);
- if (promotionSelection.empty())
+ if (promotionSelection.isEmpty())
return NoHomogenousSelection;
QDesignerFormEditorInterface *core = formWindow->core();
@@ -137,7 +137,7 @@ PromotionTaskMenu::PromotionState PromotionTaskMenu::createPromotionActions(QDe
// figure out candidates
const QString baseClassName = WidgetFactory::classNameOf(core, m_widget);
const WidgetDataBaseItemList candidates = promotionCandidates(core->widgetDataBase(), baseClassName );
- if (candidates.empty()) {
+ if (candidates.isEmpty()) {
// Is this thing promotable at all?
return QDesignerPromotionDialog::baseClassNames(core->promotion()).contains(baseClassName) ? CanPromote : NotApplicable;
}
@@ -230,7 +230,7 @@ void PromotionTaskMenu::slotDemoteFromCustomWidget()
{
QDesignerFormWindowInterface *fw = formWindow();
const PromotionSelectionList promotedWidgets = promotionSelectionList(fw);
- Q_ASSERT(!promotedWidgets.empty() && isPromoted(fw->core(), promotedWidgets.front()));
+ Q_ASSERT(!promotedWidgets.isEmpty() && isPromoted(fw->core(), promotedWidgets.constFirst()));
// ### use the undo stack
DemoteFromCustomWidgetCommand *cmd = new DemoteFromCustomWidgetCommand(fw);
diff --git a/src/designer/src/lib/shared/qdesigner_command.cpp b/src/designer/src/lib/shared/qdesigner_command.cpp
index 7346b98f3..59c27f5f5 100644
--- a/src/designer/src/lib/shared/qdesigner_command.cpp
+++ b/src/designer/src/lib/shared/qdesigner_command.cpp
@@ -235,7 +235,7 @@ void InsertWidgetCommand::refreshBuddyLabels()
using LabelList = QList<QLabel *>;
const LabelList label_list = formWindow()->findChildren<QLabel*>();
- if (label_list.empty())
+ if (label_list.isEmpty())
return;
const QString buddyProperty = QStringLiteral("buddy");
@@ -350,7 +350,7 @@ void ManageWidgetCommandHelper::init(const QDesignerFormWindowInterface *fw, QWi
m_managedChildren.clear();
const QWidgetList children = m_widget->findChildren<QWidget *>();
- if (children.empty())
+ if (children.isEmpty())
return;
m_managedChildren.reserve(children.size());
@@ -370,7 +370,7 @@ void ManageWidgetCommandHelper::manage(QDesignerFormWindowInterface *fw)
{
// Manage the managed children after parent
fw->manageWidget(m_widget);
- if (!m_managedChildren.empty()) {
+ if (!m_managedChildren.isEmpty()) {
const WidgetVector::const_iterator lcend = m_managedChildren.constEnd();
for (WidgetVector::const_iterator it = m_managedChildren.constBegin(); it != lcend; ++it)
fw->manageWidget(*it);
@@ -380,7 +380,7 @@ void ManageWidgetCommandHelper::manage(QDesignerFormWindowInterface *fw)
void ManageWidgetCommandHelper::unmanage(QDesignerFormWindowInterface *fw)
{
// Unmanage the managed children first
- if (!m_managedChildren.empty()) {
+ if (!m_managedChildren.isEmpty()) {
const WidgetVector::const_iterator lcend = m_managedChildren.constEnd();
for (WidgetVector::const_iterator it = m_managedChildren.constBegin(); it != lcend; ++it)
fw->unmanageWidget(*it);
@@ -665,7 +665,7 @@ DemoteFromCustomWidgetCommand::DemoteFromCustomWidgetCommand
void DemoteFromCustomWidgetCommand::init(const WidgetList &promoted)
{
- m_promote_cmd.init(promoted, promotedCustomClassName(core(), promoted.front()));
+ m_promote_cmd.init(promoted, promotedCustomClassName(core(), promoted.constFirst()));
}
void DemoteFromCustomWidgetCommand::redo()
@@ -695,7 +695,7 @@ void CursorSelectionState::save(const QDesignerFormWindowInterface *formWindow)
void CursorSelectionState::restore(QDesignerFormWindowInterface *formWindow) const
{
- if (m_selection.empty()) {
+ if (m_selection.isEmpty()) {
formWindow->clearSelection(true);
} else {
// Select current as last
@@ -2692,7 +2692,7 @@ void RemoveActionCommand::redo()
core()->actionEditor()->setFormWindow(fw);
core()->actionEditor()->unmanageAction(m_action);
- if (!m_actionData.empty())
+ if (!m_actionData.isEmpty())
core()->objectInspector()->setFormWindow(fw);
}
@@ -2702,7 +2702,7 @@ void RemoveActionCommand::undo()
core()->actionEditor()->manageAction(m_action);
for (const ActionDataItem &item : qAsConst(m_actionData))
item.widget->insertAction(item.before, m_action);
- if (!m_actionData.empty())
+ if (!m_actionData.isEmpty())
core()->objectInspector()->setFormWindow(formWindow());
}
diff --git a/src/designer/src/lib/shared/qdesigner_dnditem.cpp b/src/designer/src/lib/shared/qdesigner_dnditem.cpp
index db714d950..a4add41ff 100644
--- a/src/designer/src/lib/shared/qdesigner_dnditem.cpp
+++ b/src/designer/src/lib/shared/qdesigner_dnditem.cpp
@@ -206,7 +206,7 @@ Qt::DropAction QDesignerMimeData::proposedDropAction() const
Qt::DropAction QDesignerMimeData::execDrag(const QDesignerDnDItems &items, QWidget * dragSource)
{
- if (items.empty())
+ if (items.isEmpty())
return Qt::IgnoreAction;
QDrag *drag = new QDrag(dragSource);
diff --git a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp
index 260316381..3b25125af 100644
--- a/src/designer/src/lib/shared/qdesigner_formbuilder.cpp
+++ b/src/designer/src/lib/shared/qdesigner_formbuilder.cpp
@@ -226,7 +226,7 @@ static bool readDomEnumerationValue(const DomProperty *p,
void QDesignerFormBuilder::applyProperties(QObject *o, const QList<DomProperty*> &properties)
{
- if (properties.empty())
+ if (properties.isEmpty())
return;
const QDesignerPropertySheetExtension *sheet = qt_extension<QDesignerPropertySheetExtension*>(core()->extensionManager(), o);
diff --git a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
index 7c44ec4f7..f1a15c48e 100644
--- a/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
+++ b/src/designer/src/lib/shared/qdesigner_formwindowcommand.cpp
@@ -103,7 +103,7 @@ void QDesignerFormWindowCommand::updateBuddies(QDesignerFormWindowInterface *for
using LabelList = QList<QLabel *>;
const LabelList label_list = form->findChildren<QLabel*>();
- if (label_list.empty())
+ if (label_list.isEmpty())
return;
const QString buddyProperty = QStringLiteral("buddy");
diff --git a/src/designer/src/lib/shared/qdesigner_introspection.cpp b/src/designer/src/lib/shared/qdesigner_introspection.cpp
index 3001d6b76..344fed976 100644
--- a/src/designer/src/lib/shared/qdesigner_introspection.cpp
+++ b/src/designer/src/lib/shared/qdesigner_introspection.cpp
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
// Qt Implementation
static QStringList byteArrayListToStringList(const QByteArrayList &l)
{
- if (l.empty())
+ if (l.isEmpty())
return QStringList();
QStringList rc;
for (const QByteArray &b : l)
diff --git a/src/designer/src/lib/shared/qdesigner_membersheet.cpp b/src/designer/src/lib/shared/qdesigner_membersheet.cpp
index 93371ac06..2e62aab7f 100644
--- a/src/designer/src/lib/shared/qdesigner_membersheet.cpp
+++ b/src/designer/src/lib/shared/qdesigner_membersheet.cpp
@@ -36,7 +36,7 @@ QT_BEGIN_NAMESPACE
static QList<QByteArray> stringListToByteArray(const QStringList &l)
{
- if (l.empty())
+ if (l.isEmpty())
return QList<QByteArray>();
QList<QByteArray> rc;
const QStringList::const_iterator cend = l.constEnd();
diff --git a/src/designer/src/lib/shared/qdesigner_menu.cpp b/src/designer/src/lib/shared/qdesigner_menu.cpp
index 88668ea45..c56a4517b 100644
--- a/src/designer/src/lib/shared/qdesigner_menu.cpp
+++ b/src/designer/src/lib/shared/qdesigner_menu.cpp
@@ -708,7 +708,7 @@ QDesignerMenu::ActionDragCheck QDesignerMenu::checkAction(QAction *action) const
void QDesignerMenu::dragEnterEvent(QDragEnterEvent *event)
{
const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData());
- if (!d || d->actionList().empty()) {
+ if (!d || d->actionList().isEmpty()) {
event->ignore();
return;
}
@@ -740,7 +740,7 @@ void QDesignerMenu::dragMoveEvent(QDragMoveEvent *event)
}
const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData());
- if (!d || d->actionList().empty()) {
+ if (!d || d->actionList().isEmpty()) {
event->ignore();
return;
}
@@ -785,7 +785,7 @@ void QDesignerMenu::dropEvent(QDropEvent *event)
QDesignerFormWindowInterface *fw = formWindow();
const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData());
- if (!d || d->actionList().empty()) {
+ if (!d || d->actionList().isEmpty()) {
event->ignore();
return;
}
diff --git a/src/designer/src/lib/shared/qdesigner_menubar.cpp b/src/designer/src/lib/shared/qdesigner_menubar.cpp
index e212eff82..287a2fc3c 100644
--- a/src/designer/src/lib/shared/qdesigner_menubar.cpp
+++ b/src/designer/src/lib/shared/qdesigner_menubar.cpp
@@ -604,7 +604,7 @@ QDesignerMenuBar::ActionDragCheck QDesignerMenuBar::checkAction(QAction *action)
void QDesignerMenuBar::dragEnterEvent(QDragEnterEvent *event)
{
const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData());
- if (!d || d->actionList().empty()) {
+ if (!d || d->actionList().isEmpty()) {
event->ignore();
return;
}
@@ -629,7 +629,7 @@ void QDesignerMenuBar::dragEnterEvent(QDragEnterEvent *event)
void QDesignerMenuBar::dragMoveEvent(QDragMoveEvent *event)
{
const ActionRepositoryMimeData *d = qobject_cast<const ActionRepositoryMimeData*>(event->mimeData());
- if (!d || d->actionList().empty()) {
+ if (!d || d->actionList().isEmpty()) {
event->ignore();
return;
}
diff --git a/src/designer/src/lib/shared/qdesigner_objectinspector.cpp b/src/designer/src/lib/shared/qdesigner_objectinspector.cpp
index e07504259..c672dca70 100644
--- a/src/designer/src/lib/shared/qdesigner_objectinspector.cpp
+++ b/src/designer/src/lib/shared/qdesigner_objectinspector.cpp
@@ -50,7 +50,7 @@ void Selection::clear()
bool Selection::empty() const
{
- return managed.empty() && unmanaged.empty() && objects.empty();
+ return managed.isEmpty() && unmanaged.isEmpty() && objects.isEmpty();
}
QObjectList Selection::selection() const
diff --git a/src/designer/src/lib/shared/qdesigner_promotion.cpp b/src/designer/src/lib/shared/qdesigner_promotion.cpp
index 2d8169960..08b2848fd 100644
--- a/src/designer/src/lib/shared/qdesigner_promotion.cpp
+++ b/src/designer/src/lib/shared/qdesigner_promotion.cpp
@@ -48,7 +48,7 @@ namespace {
// Return a set of on-promotable classes
const QSet<QString> &nonPromotableClasses() {
static QSet<QString> rc;
- if (rc.empty()) {
+ if (rc.isEmpty()) {
rc.insert(QStringLiteral("Line"));
rc.insert(QStringLiteral("QAction"));
rc.insert(QStringLiteral("Spacer"));
@@ -225,7 +225,7 @@ namespace qdesigner_internal {
// convert map into list.
PromotedClasses rc;
- if (baseClassPromotedMap.empty())
+ if (baseClassPromotedMap.isEmpty())
return rc;
const BaseClassPromotedMap::const_iterator bcend = baseClassPromotedMap.constEnd();
@@ -262,7 +262,7 @@ namespace qdesigner_internal {
// check the scratchpad of the widget box
if (QDesignerWidgetBoxInterface *widgetBox = m_core->widgetBox()) {
const QStringList scratchPadClasses = getScratchPadClasses(widgetBox);
- if (!scratchPadClasses.empty()) {
+ if (!scratchPadClasses.isEmpty()) {
// Check whether these are actually promoted
QDesignerWidgetDataBaseInterface *widgetDataBase = m_core->widgetDataBase();
QStringList::const_iterator cend = scratchPadClasses.constEnd();
diff --git a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp
index 7058b0c81..1ec5cd9ae 100644
--- a/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp
+++ b/src/designer/src/lib/shared/qdesigner_promotiondialog.cpp
@@ -290,7 +290,7 @@ namespace qdesigner_internal {
const QStringList &QDesignerPromotionDialog::baseClassNames(const QDesignerPromotionInterface *promotion) {
using WidgetDataBaseItemList = QList<QDesignerWidgetDataBaseItemInterface *>;
static QStringList rc;
- if (rc.empty()) {
+ if (rc.isEmpty()) {
// Convert the item list into a string list.
const WidgetDataBaseItemList dbItems = promotion->promotionBaseClasses();
const WidgetDataBaseItemList::const_iterator cend = dbItems.constEnd();
@@ -351,7 +351,7 @@ namespace qdesigner_internal {
QDesignerWidgetDataBaseItemInterface *QDesignerPromotionDialog::databaseItemAt(const QItemSelection &selected, unsigned &flags) const {
flags = 0;
const QModelIndexList indexes = selected.indexes();
- if (indexes.empty())
+ if (indexes.isEmpty())
return nullptr;
const PromotionModel::ModelData data = m_model->modelData(indexes.constFirst());
QDesignerWidgetDataBaseItemInterface *dbItem = data.promotedItem;
diff --git a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp
index 8b564ab6f..eab11e033 100644
--- a/src/designer/src/lib/shared/qdesigner_propertycommand.cpp
+++ b/src/designer/src/lib/shared/qdesigner_propertycommand.cpp
@@ -646,7 +646,7 @@ PropertyHelper::PropertyHelper(QObject* object,
m_objectType = OT_Widget;
} else {
if (const QAction *action = qobject_cast<const QAction *>(m_object))
- m_objectType = action->associatedWidgets().empty() ? OT_FreeAction : OT_AssociatedAction;
+ m_objectType = action->associatedWidgets().isEmpty() ? OT_FreeAction : OT_AssociatedAction;
}
if(debugPropertyCommands)
@@ -982,7 +982,7 @@ bool PropertyListCommand::add(QObject *object, const QString &propertyName)
const PropertyDescription description(propertyName, sheet, index);
- if (m_propertyHelperList.empty()) {
+ if (m_propertyHelperList.isEmpty()) {
// first entry
m_propertyDescription = description;
} else {
@@ -1018,7 +1018,7 @@ bool PropertyListCommand::initList(const QObjectList &list, const QString &aprop
add(o, apropertyName);
}
- return !propertyHelperList().empty();
+ return !propertyHelperList().isEmpty();
}
diff --git a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp
index 3a26553fd..69f1cdf87 100644
--- a/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp
+++ b/src/designer/src/lib/shared/qdesigner_propertyeditor.cpp
@@ -49,7 +49,7 @@ using PropertyNameTypeMap = QHash<QString, StringPropertyParameters>;
static const PropertyNameTypeMap &stringPropertyTypes()
{
static PropertyNameTypeMap propertyNameTypeMap;
- if (propertyNameTypeMap.empty()) {
+ if (propertyNameTypeMap.isEmpty()) {
const StringPropertyParameters richtext(ValidationRichText, true);
// Accessibility. Both are texts the narrator reads
propertyNameTypeMap.insert(QStringLiteral("accessibleDescription"), richtext);
diff --git a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp
index eafc0de4f..5ec212ec3 100644
--- a/src/designer/src/lib/shared/qdesigner_propertysheet.cpp
+++ b/src/designer/src/lib/shared/qdesigner_propertysheet.cpp
@@ -470,7 +470,7 @@ QString QDesignerPropertySheetPrivate::transformLayoutPropertyName(int index) co
{
using TypeNameMap = QMap<QDesignerPropertySheet::PropertyType, QString>;
static TypeNameMap typeNameMap;
- if (typeNameMap.empty()) {
+ if (typeNameMap.isEmpty()) {
typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutObjectName, QStringLiteral("objectName"));
typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutLeftMargin, QStringLiteral("leftMargin"));
typeNameMap.insert(QDesignerPropertySheet::PropertyLayoutTopMargin, QStringLiteral("topMargin"));
@@ -519,7 +519,7 @@ QDesignerPropertySheet::PropertyType QDesignerPropertySheet::propertyTypeFromNam
{
typedef QHash<QString, PropertyType> PropertyTypeHash;
static PropertyTypeHash propertyTypeHash;
- if (propertyTypeHash.empty()) {
+ if (propertyTypeHash.isEmpty()) {
propertyTypeHash.insert(QLatin1String(layoutObjectNameC), PropertyLayoutObjectName);
propertyTypeHash.insert(QLatin1String(layoutLeftMarginC), PropertyLayoutLeftMargin);
propertyTypeHash.insert(QLatin1String(layoutTopMarginC), PropertyLayoutTopMargin);
@@ -676,7 +676,7 @@ QDesignerPropertySheet::QDesignerPropertySheet(QObject *object, QObject *parent)
using ByteArrayList = QList<QByteArray>;
const ByteArrayList names = object->dynamicPropertyNames();
- if (!names.empty()) {
+ if (!names.isEmpty()) {
const ByteArrayList::const_iterator cend = names.constEnd();
for (ByteArrayList::const_iterator it = names.constBegin(); it != cend; ++it) {
const char* cName = it->constData();
diff --git a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp
index 2f003cf6c..9500f0673 100644
--- a/src/designer/src/lib/shared/qdesigner_tabwidget.cpp
+++ b/src/designer/src/lib/shared/qdesigner_tabwidget.cpp
@@ -120,7 +120,7 @@ QTabBar *QTabWidgetEventFilter::tabBar() const
if (!m_cachedTabBar) {
const QList<QTabBar *> tabBars = m_tabWidget->findChildren<QTabBar *>();
Q_ASSERT(tabBars.size() == 1);
- m_cachedTabBar = tabBars.front();
+ m_cachedTabBar = tabBars.constFirst();
}
return m_cachedTabBar;
@@ -406,7 +406,7 @@ QTabWidgetPropertySheet::TabWidgetProperty QTabWidgetPropertySheet::tabWidgetPro
{
using TabWidgetPropertyHash = QHash<QString, TabWidgetProperty>;
static TabWidgetPropertyHash tabWidgetPropertyHash;
- if (tabWidgetPropertyHash.empty()) {
+ if (tabWidgetPropertyHash.isEmpty()) {
tabWidgetPropertyHash.insert(QLatin1String(currentTabTextKey), PropertyCurrentTabText);
tabWidgetPropertyHash.insert(QLatin1String(currentTabNameKey), PropertyCurrentTabName);
tabWidgetPropertyHash.insert(QLatin1String(currentTabIconKey), PropertyCurrentTabIcon);
diff --git a/src/designer/src/lib/shared/qdesigner_toolbar.cpp b/src/designer/src/lib/shared/qdesigner_toolbar.cpp
index 28c2ca285..840d99a57 100644
--- a/src/designer/src/lib/shared/qdesigner_toolbar.cpp
+++ b/src/designer/src/lib/shared/qdesigner_toolbar.cpp
@@ -138,7 +138,7 @@ ActionList ToolBarEventFilter::contextMenuActions(const QPoint &globalPos)
}
// Append separator
- if (actions.empty() || !actions.back()->isSeparator()) {
+ if (actions.isEmpty() || !actions.constLast()->isSeparator()) {
QAction *newSeperatorAct = new QAction(tr("Append Separator"), nullptr);
itemData.setValue(static_cast<QAction*>(nullptr));
newSeperatorAct->setData(itemData);
@@ -448,7 +448,8 @@ QRect ToolBarEventFilter::freeArea(const QToolBar *tb)
{
QRect rc = QRect(QPoint(0, 0), tb->size());
const ActionList actionList = tb->actions();
- QRect exclusionRectangle = actionList.empty() ? handleArea(tb) : tb->actionGeometry(actionList.back());
+ QRect exclusionRectangle = actionList.isEmpty()
+ ? handleArea(tb) : tb->actionGeometry(actionList.constLast());
switch (tb->orientation()) {
case Qt::Horizontal:
switch (tb->layoutDirection()) {
diff --git a/src/designer/src/lib/shared/qdesigner_toolbox.cpp b/src/designer/src/lib/shared/qdesigner_toolbox.cpp
index f0c0dc726..3a7ed6307 100644
--- a/src/designer/src/lib/shared/qdesigner_toolbox.cpp
+++ b/src/designer/src/lib/shared/qdesigner_toolbox.cpp
@@ -256,7 +256,7 @@ QToolBoxWidgetPropertySheet::ToolBoxProperty QToolBoxWidgetPropertySheet::toolBo
{
using ToolBoxPropertyHash = QHash<QString, ToolBoxProperty>;
static ToolBoxPropertyHash toolBoxPropertyHash;
- if (toolBoxPropertyHash.empty()) {
+ if (toolBoxPropertyHash.isEmpty()) {
toolBoxPropertyHash.insert(QLatin1String(currentItemTextKey), PropertyCurrentItemText);
toolBoxPropertyHash.insert(QLatin1String(currentItemNameKey), PropertyCurrentItemName);
toolBoxPropertyHash.insert(QLatin1String(currentItemIconKey), PropertyCurrentItemIcon);
diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp
index a7c4fdd72..40b7d8464 100644
--- a/src/designer/src/lib/shared/qdesigner_utils.cpp
+++ b/src/designer/src/lib/shared/qdesigner_utils.cpp
@@ -198,7 +198,7 @@ namespace qdesigner_internal
QString DesignerMetaFlags::toString(int value, SerializationMode sm) const
{
const QStringList flagIds = flags(value);
- if (flagIds.empty())
+ if (flagIds.isEmpty())
return QString();
const QChar delimiter = QLatin1Char('|');
diff --git a/src/designer/src/lib/shared/qlayout_widget.cpp b/src/designer/src/lib/shared/qlayout_widget.cpp
index 852002838..52965171f 100644
--- a/src/designer/src/lib/shared/qlayout_widget.cpp
+++ b/src/designer/src/lib/shared/qlayout_widget.cpp
@@ -217,7 +217,7 @@ static bool removeEmptyCellsOnGrid(GridLikeLayout *grid, const QRect &area)
}
}
// remove, starting from last
- if (!indexesToBeRemoved.empty()) {
+ if (!indexesToBeRemoved.isEmpty()) {
std::stable_sort(indexesToBeRemoved.begin(), indexesToBeRemoved.end());
for (int i = indexesToBeRemoved.size() - 1; i >= 0; i--)
delete grid->takeAt(indexesToBeRemoved[i]);
@@ -979,7 +979,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const
void GridLayoutHelper::popState(const QDesignerFormEditorInterface *core, QWidget *widgetWithManagedLayout)
{
- Q_ASSERT(!m_states.empty());
+ Q_ASSERT(!m_states.isEmpty());
const GridLayoutState state = m_states.pop();
state.applyToLayout(core, widgetWithManagedLayout);
}
@@ -1137,7 +1137,7 @@ QRect LayoutHelper::itemInfo(QLayout *lt, const QWidget *widget) const
void FormLayoutHelper::popState(const QDesignerFormEditorInterface *core, QWidget *widgetWithManagedLayout)
{
QFormLayout *formLayout = qobject_cast<QFormLayout *>(LayoutInfo::managedLayout(core, widgetWithManagedLayout));
- Q_ASSERT(!m_states.empty() && formLayout);
+ Q_ASSERT(!m_states.isEmpty() && formLayout);
const FormLayoutState storedState = m_states.pop();
const FormLayoutState currentState = state(formLayout);
diff --git a/src/designer/src/lib/shared/qsimpleresource.cpp b/src/designer/src/lib/shared/qsimpleresource.cpp
index 705d7b608..3d79379b2 100644
--- a/src/designer/src/lib/shared/qsimpleresource.cpp
+++ b/src/designer/src/lib/shared/qsimpleresource.cpp
@@ -224,7 +224,7 @@ void QSimpleResource::handleDomCustomWidgets(const QDesignerFormEditorInterface
// (derived first, max depth: promoted custom plugin = 2)
for (int iteration = 0; iteration < 2; iteration++) {
addCustomWidgetsToWidgetDatabase(core, custom_widget_list);
- if (custom_widget_list.empty())
+ if (custom_widget_list.isEmpty())
return;
}
// Oops, there are classes left whose base class could not be found.
@@ -250,7 +250,7 @@ FormBuilderClipboard::FormBuilderClipboard(QWidget *w)
bool FormBuilderClipboard::empty() const
{
- return m_widgets.empty() && m_actions.empty();
+ return m_widgets.isEmpty() && m_actions.isEmpty();
}
}
diff --git a/src/designer/src/lib/shared/qtresourcemodel.cpp b/src/designer/src/lib/shared/qtresourcemodel.cpp
index 1586fcf44..7801cf580 100644
--- a/src/designer/src/lib/shared/qtresourcemodel.cpp
+++ b/src/designer/src/lib/shared/qtresourcemodel.cpp
@@ -169,7 +169,7 @@ const QByteArray *QtResourceModelPrivate::createResource(const QString &path, QS
*errorCount = library.failedResources().size();
*contents = resMap.keys();
- if (resMap.empty())
+ if (resMap.isEmpty())
break;
buffer.close();
diff --git a/src/designer/src/lib/shared/shared_settings.cpp b/src/designer/src/lib/shared/shared_settings.cpp
index b759555bd..2800e89c5 100644
--- a/src/designer/src/lib/shared/shared_settings.cpp
+++ b/src/designer/src/lib/shared/shared_settings.cpp
@@ -90,7 +90,7 @@ Grid QDesignerSharedSettings::defaultGrid() const
Grid grid;
const QVariantMap defaultGridMap
= m_settings->value(QLatin1String(defaultGridKey), QVariantMap()).toMap();
- if (!defaultGridMap.empty())
+ if (!defaultGridMap.isEmpty())
grid.fromVariantMap(defaultGridMap);
return grid;
}
@@ -103,7 +103,7 @@ void QDesignerSharedSettings::setDefaultGrid(const Grid &grid)
const QStringList &QDesignerSharedSettings::defaultFormTemplatePaths()
{
static QStringList rc;
- if (rc.empty()) {
+ if (rc.isEmpty()) {
// Ensure default form template paths
const QString templatePath = QStringLiteral("/templates");
// home
@@ -300,7 +300,7 @@ QDesignerSharedSettings::DeviceProfileList QDesignerSharedSettings::deviceProfil
{
DeviceProfileList rc;
const QStringList xmls = deviceProfileXml();
- if (xmls.empty())
+ if (xmls.isEmpty())
return rc;
// De-serialize
QString errorMessage;
diff --git a/src/designer/src/lib/shared/signalslotdialog.cpp b/src/designer/src/lib/shared/signalslotdialog.cpp
index 5c0d9e1fe..9b7575177 100644
--- a/src/designer/src/lib/shared/signalslotdialog.cpp
+++ b/src/designer/src/lib/shared/signalslotdialog.cpp
@@ -270,7 +270,7 @@ void SignaturePanel::slotAdd()
newSlot += QString::number(i); // Always add number, Avoid setting 'slot' for first entry
newSlot += QLatin1Char('(');
// check for function name independent of parameters
- if (m_model->findItems(newSlot, Qt::MatchStartsWith, 0).empty()) {
+ if (m_model->findItems(newSlot, Qt::MatchStartsWith, 0).isEmpty()) {
newSlot += QLatin1Char(')');
QStandardItem * item = createEditableItem(newSlot);
m_model->appendRow(item);
@@ -290,13 +290,13 @@ int SignaturePanel::count(const QString &signature) const
void SignaturePanel::slotRemove()
{
const QModelIndexList selectedIndexes = m_listView->selectionModel()->selectedIndexes ();
- if (selectedIndexes.empty())
+ if (selectedIndexes.isEmpty())
return;
closeEditor();
// scroll to previous
- if (const int row = selectedIndexes.front().row())
- m_listView->setCurrentIndex (selectedIndexes.front().sibling(row - 1, 0));
+ if (const int row = selectedIndexes.constFirst().row())
+ m_listView->setCurrentIndex (selectedIndexes.constFirst().sibling(row - 1, 0));
for (int i = selectedIndexes.size() - 1; i >= 0; i--)
qDeleteAll(m_model->takeRow(selectedIndexes[i].row()));
@@ -304,7 +304,7 @@ void SignaturePanel::slotRemove()
void SignaturePanel::slotSelectionChanged(const QItemSelection &selected, const QItemSelection &)
{
- m_removeButton->setEnabled(!selected.indexes().empty());
+ m_removeButton->setEnabled(!selected.indexes().isEmpty());
}
void SignaturePanel::setData(const SignalSlotDialogData &d)
diff --git a/src/designer/src/lib/shared/textpropertyeditor.cpp b/src/designer/src/lib/shared/textpropertyeditor.cpp
index 88e8841b6..e78cb81b4 100644
--- a/src/designer/src/lib/shared/textpropertyeditor.cpp
+++ b/src/designer/src/lib/shared/textpropertyeditor.cpp
@@ -259,7 +259,7 @@ namespace qdesigner_internal {
break;
case ValidationURL: {
static QStringList urlCompletions;
- if (urlCompletions.empty()) {
+ if (urlCompletions.isEmpty()) {
urlCompletions.push_back(QStringLiteral("about:blank"));
urlCompletions.push_back(QStringLiteral("http://"));
urlCompletions.push_back(QStringLiteral("http://www."));
diff --git a/src/designer/src/lib/shared/widgetdatabase.cpp b/src/designer/src/lib/shared/widgetdatabase.cpp
index 5fecd4c98..8c6382112 100644
--- a/src/designer/src/lib/shared/widgetdatabase.cpp
+++ b/src/designer/src/lib/shared/widgetdatabase.cpp
@@ -373,7 +373,7 @@ void WidgetDataBase::loadPlugins()
unsigned replacedPlugins = 0;
unsigned addedPlugins = 0;
unsigned removedPlugins = 0;
- if (!pluginList.empty()) {
+ if (!pluginList.isEmpty()) {
ItemList::const_iterator cend = pluginList.constEnd();
for (ItemList::const_iterator it = pluginList.constBegin();it != cend; ++it ) {
QDesignerWidgetDataBaseItemInterface* pluginItem = *it;
@@ -399,7 +399,7 @@ void WidgetDataBase::loadPlugins()
}
}
// 4) remove classes that have not been matched. The stored indexes become invalid while deleting.
- if (!existingCustomClasses.empty()) {
+ if (!existingCustomClasses.isEmpty()) {
NameIndexMap::const_iterator cend = existingCustomClasses.constEnd();
for (NameIndexMap::const_iterator it = existingCustomClasses.constBegin();it != cend; ++it ) {
const int index = indexOfClassName(it.key());
@@ -503,7 +503,7 @@ static inline bool suitableForNewForm(const QString &className)
QStringList WidgetDataBase::formWidgetClasses(const QDesignerFormEditorInterface *core)
{
static QStringList rc;
- if (rc.empty()) {
+ if (rc.isEmpty()) {
const QDesignerWidgetDataBaseInterface *wdb = core->widgetDataBase();
const int widgetCount = wdb->count();
for (int i = 0; i < widgetCount; i++) {
diff --git a/src/designer/src/lib/uilib/abstractformbuilder.cpp b/src/designer/src/lib/uilib/abstractformbuilder.cpp
index 686442af0..c6b7b2375 100644
--- a/src/designer/src/lib/uilib/abstractformbuilder.cpp
+++ b/src/designer/src/lib/uilib/abstractformbuilder.cpp
@@ -219,7 +219,7 @@ QWidget *QAbstractFormBuilder::create(DomUI *ui, QWidget *parentWidget)
if (QWidget *widget = create(ui_widget, parentWidget)) {
// Reparent button groups that were actually created to main container for them to be found in the signal/slot part
const ButtonGroupHash &buttonGroups = d->buttonGroups();
- if (!buttonGroups.empty()) {
+ if (!buttonGroups.isEmpty()) {
const ButtonGroupHash::const_iterator cend = buttonGroups.constEnd();
for (ButtonGroupHash::const_iterator it = buttonGroups.constBegin(); it != cend; ++it)
if (it.value().second)
@@ -297,7 +297,7 @@ QWidget *QAbstractFormBuilder::create(DomWidget *ui_widget, QWidget *parentWidge
}
const auto &addActions = ui_widget->elementAddAction();
- if (!addActions.empty()) {
+ if (!addActions.isEmpty()) {
const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
for (DomActionRef *ui_action_ref : addActions) {
const QString name = ui_action_ref->attributeName();
@@ -881,7 +881,7 @@ QLayoutItem *QAbstractFormBuilder::create(DomLayoutItem *ui_layoutItem, QLayout
const DomSpacer *ui_spacer = ui_layoutItem->elementSpacer();
const auto &spacerProperties = ui_spacer->elementProperty();
- if (!spacerProperties.empty()) {
+ if (!spacerProperties.isEmpty()) {
const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
for (DomProperty *p : spacerProperties) {
const QVariant v = toVariant(&QAbstractFormBuilderGadget::staticMetaObject, p); // ### remove me
@@ -1592,7 +1592,7 @@ DomButtonGroups *QAbstractFormBuilder::saveButtonGroups(const QWidget *mainConta
{
// Save fst order buttongroup children of maincontainer
const QObjectList &mchildren = mainContainer->children();
- if (mchildren.empty())
+ if (mchildren.isEmpty())
return nullptr;
QVector<DomButtonGroup *> domGroups;
for (QObject *o : mchildren) {
@@ -1600,7 +1600,7 @@ DomButtonGroups *QAbstractFormBuilder::saveButtonGroups(const QWidget *mainConta
if (DomButtonGroup* dg = createDom(bg))
domGroups.push_back(dg);
}
- if (domGroups.empty())
+ if (domGroups.isEmpty())
return nullptr;
DomButtonGroups *rc = new DomButtonGroups;
rc->setElementButtonGroup(domGroups);
@@ -2263,7 +2263,7 @@ void QAbstractFormBuilder::loadComboBoxExtraInfo(DomWidget *ui_widget, QComboBox
static QString buttonGroupName(const DomWidget *ui_widget)
{
const auto &attributes = ui_widget->elementAttribute();
- if (attributes.empty())
+ if (attributes.isEmpty())
return QString();
const QString buttonGroupProperty = QLatin1String(buttonGroupPropertyC);
for (const DomProperty *p : attributes) {
diff --git a/src/designer/src/lib/uilib/formbuilder.cpp b/src/designer/src/lib/uilib/formbuilder.cpp
index 31bfdfde4..4230e27f7 100644
--- a/src/designer/src/lib/uilib/formbuilder.cpp
+++ b/src/designer/src/lib/uilib/formbuilder.cpp
@@ -517,7 +517,7 @@ QList<QDesignerCustomWidgetInterface*> QFormBuilder::customWidgets() const
void QFormBuilder::applyProperties(QObject *o, const QList<DomProperty*> &properties)
{
- if (properties.empty())
+ if (properties.isEmpty())
return;
const QFormBuilderStrings &strings = QFormBuilderStrings::instance();
diff --git a/src/designer/src/lib/uilib/formbuilderextra.cpp b/src/designer/src/lib/uilib/formbuilderextra.cpp
index e3a59af9c..14174711f 100644
--- a/src/designer/src/lib/uilib/formbuilderextra.cpp
+++ b/src/designer/src/lib/uilib/formbuilderextra.cpp
@@ -207,7 +207,7 @@ bool QFormBuilderExtra::applyPropertyInternally(QObject *o, const QString &prope
void QFormBuilderExtra::applyInternalProperties() const
{
- if (m_buddies.empty())
+ if (m_buddies.isEmpty())
return;
const BuddyHash::const_iterator cend = m_buddies.constEnd();
@@ -223,7 +223,7 @@ bool QFormBuilderExtra::applyBuddy(const QString &buddyName, BuddyMode applyMode
}
const QWidgetList widgets = label->topLevelWidget()->findChildren<QWidget*>(buddyName);
- if (widgets.empty()) {
+ if (widgets.isEmpty()) {
label->setBuddy(nullptr);
return false;
}
@@ -387,7 +387,7 @@ inline bool parsePerCellProperty(Layout *l, int count, void (Layout::*setter)(in
return true;
}
const QVector<QStringRef> list = s.splitRef(QLatin1Char(','));
- if (list.empty()) {
+ if (list.isEmpty()) {
clearPerCellValue(l, count, setter, defaultValue);
return true;
}
diff --git a/src/designer/src/uitools/quiloader.cpp b/src/designer/src/uitools/quiloader.cpp
index e5f157fb1..4aec975d9 100644
--- a/src/designer/src/uitools/quiloader.cpp
+++ b/src/designer/src/uitools/quiloader.cpp
@@ -438,7 +438,7 @@ void FormBuilderPrivate::applyProperties(QObject *o, const QList<DomProperty*> &
if (!m_trwatch)
m_trwatch = new TranslationWatcher(o, m_class, m_idBased);
- if (properties.empty())
+ if (properties.isEmpty())
return;
// Unlike string item roles, string properties are not loaded via the textBuilder
diff --git a/src/shared/fontpanel/fontpanel.cpp b/src/shared/fontpanel/fontpanel.cpp
index 6121421fc..59238f6eb 100644
--- a/src/shared/fontpanel/fontpanel.cpp
+++ b/src/shared/fontpanel/fontpanel.cpp
@@ -119,10 +119,10 @@ void FontPanel::setSelectedFont(const QFont &f)
if (m_familyComboBox->currentIndex() < 0) {
// family not in writing system - find the corresponding one?
QList<QFontDatabase::WritingSystem> familyWritingSystems = m_fontDatabase.writingSystems(f.family());
- if (familyWritingSystems.empty())
+ if (familyWritingSystems.isEmpty())
return;
- setWritingSystem(familyWritingSystems.front());
+ setWritingSystem(familyWritingSystems.constFirst());
m_familyComboBox->setCurrentFont(f);
}
@@ -213,7 +213,7 @@ void FontPanel::updateFamily(const QString &family)
const QString &oldStyleString = styleString();
const QStringList &styles = m_fontDatabase.styles(family);
- const bool hasStyles = !styles.empty();
+ const bool hasStyles = !styles.isEmpty();
m_styleComboBox->setCurrentIndex(-1);
m_styleComboBox->clear();
@@ -270,10 +270,10 @@ void FontPanel::updatePointSizes(const QString &family, const QString &styleStri
const int oldPointSize = pointSize();
QList<int> pointSizes = m_fontDatabase.pointSizes(family, styleString);
- if (pointSizes.empty())
+ if (pointSizes.isEmpty())
pointSizes = QFontDatabase::standardSizes();
- const bool hasSizes = !pointSizes.empty();
+ const bool hasSizes = !pointSizes.isEmpty();
m_pointSizeComboBox->clear();
m_pointSizeComboBox->setEnabled(hasSizes);
m_pointSizeComboBox->setCurrentIndex(-1);
diff --git a/src/shared/qtpropertybrowser/qteditorfactory.cpp b/src/shared/qtpropertybrowser/qteditorfactory.cpp
index 664667c65..aa3ddbf00 100644
--- a/src/shared/qtpropertybrowser/qteditorfactory.cpp
+++ b/src/shared/qtpropertybrowser/qteditorfactory.cpp
@@ -124,7 +124,7 @@ void EditorFactoryPrivate<Editor>::slotEditorDestroyed(QObject *object)
const typename PropertyToEditorListMap::iterator pit = m_createdEditors.find(property);
if (pit != m_createdEditors.end()) {
pit.value().removeAll(editor);
- if (pit.value().empty())
+ if (pit.value().isEmpty())
m_createdEditors.erase(pit);
}
m_editorToProperty.erase(itEditor);
diff --git a/src/shared/qtpropertybrowser/qtpropertymanager.cpp b/src/shared/qtpropertybrowser/qtpropertymanager.cpp
index 40a459c59..2abcb1657 100644
--- a/src/shared/qtpropertybrowser/qtpropertymanager.cpp
+++ b/src/shared/qtpropertybrowser/qtpropertymanager.cpp
@@ -5660,7 +5660,7 @@ void QtFontPropertyManagerPrivate::slotFontDatabaseDelayedChange()
m_familyNames = fontDatabase()->families();
// Adapt all existing properties
- if (!m_propertyToFamily.empty()) {
+ if (!m_propertyToFamily.isEmpty()) {
PropertyPropertyMap::const_iterator cend = m_propertyToFamily.constEnd();
for (PropertyPropertyMap::const_iterator it = m_propertyToFamily.constBegin(); it != cend; ++it) {
QtProperty *familyProp = it.value();
@@ -5875,7 +5875,7 @@ void QtFontPropertyManager::initializeProperty(QtProperty *property)
QtProperty *familyProp = d_ptr->m_enumPropertyManager->addProperty();
familyProp->setPropertyName(tr("Family"));
- if (d_ptr->m_familyNames.empty())
+ if (d_ptr->m_familyNames.isEmpty())
d_ptr->m_familyNames = fontDatabase()->families();
d_ptr->m_enumPropertyManager->setEnumNames(familyProp, d_ptr->m_familyNames);
int idx = d_ptr->m_familyNames.indexOf(val.family());
diff --git a/src/shared/qttoolbardialog/qttoolbardialog.cpp b/src/shared/qttoolbardialog/qttoolbardialog.cpp
index bce8e4345..3e9363b93 100644
--- a/src/shared/qttoolbardialog/qttoolbardialog.cpp
+++ b/src/shared/qttoolbardialog/qttoolbardialog.cpp
@@ -1388,7 +1388,7 @@ void QtToolBarDialogPrivate::leftClicked()
ToolBarItem *item = widgetActionToToolBar.value(action);
if (item == currentToolBar) { // have to be
toolBarToWidgetActions[item].remove(action);
- if (toolBarToWidgetActions[item].empty())
+ if (toolBarToWidgetActions[item].isEmpty())
toolBarToWidgetActions.remove(item);
}
widgetActionToToolBar.insert(action, 0);
@@ -1437,7 +1437,7 @@ void QtToolBarDialogPrivate::rightClicked()
if (toolBar) {
currentState[toolBar].removeAll(action);
toolBarToWidgetActions[toolBar].remove(action);
- if (toolBarToWidgetActions[toolBar].empty())
+ if (toolBarToWidgetActions[toolBar].isEmpty())
toolBarToWidgetActions.remove(toolBar);
}
widgetActionToToolBar.insert(action, currentToolBar);