Designer: Modernize

* Remove QLatin1{Char|String}
* Use member initialization
* Use range-for
* Use nullptr

Change-Id: I51c24c0a2066861f59731585f19d61b28c76c0a3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Andre Hartmann
2017-10-16 20:47:05 +02:00
committed by André Hartmann
parent 72c283afc8
commit 1d53110402
28 changed files with 161 additions and 184 deletions

View File

@@ -34,6 +34,7 @@
#include <coreplugin/modemanager.h>
#include <coreplugin/imode.h>
#include <utils/asconst.h>
#include <utils/qtcassert.h>
#include <QDesignerFormWindowInterface>
@@ -48,10 +49,9 @@ namespace Designer {
namespace Internal {
FormEditorStack::FormEditorStack(QWidget *parent) :
QStackedWidget(parent),
m_designerCore(0)
QStackedWidget(parent)
{
setObjectName(QLatin1String("FormEditorStack"));
setObjectName("FormEditorStack");
}
void FormEditorStack::add(const EditorData &data)
@@ -153,7 +153,7 @@ void FormEditorStack::updateFormWindowSelectionHandles()
if (Designer::Constants::Internal::debug)
qDebug() << "updateFormWindowSelectionHandles";
QDesignerFormWindowInterface *activeFormWindow = m_designerCore->formWindowManager()->activeFormWindow();
foreach (const EditorData &fdm, m_formEditors) {
for (const EditorData &fdm : Utils::asConst(m_formEditors)) {
const bool active = activeFormWindow == fdm.widgetHost->formWindow();
fdm.widgetHost->updateFormWindowSelectionHandles(active);
}
@@ -166,7 +166,7 @@ void FormEditorStack::formSizeChanged(int w, int h)
qDebug() << Q_FUNC_INFO << w << h;
if (const SharedTools::WidgetHost *wh = qobject_cast<const SharedTools::WidgetHost *>(sender())) {
wh->formWindow()->setDirty(true);
static const QString geometry = QLatin1String("geometry");
static const QString geometry = "geometry";
m_designerCore->propertyEditor()->setPropertyValue(geometry, QRect(0,0,w,h) );
}
}
@@ -184,7 +184,7 @@ void FormEditorStack::modeAboutToChange(Core::Id mode)
// Sync the editor when entering edit mode
if (mode == Core::Constants::MODE_EDIT)
foreach (const EditorData &data, m_formEditors)
for (const EditorData &data : Utils::asConst(m_formEditors))
data.formWindowEditor->formWindowFile()->syncXmlFromFormWindow();
}