Qt Designer: Fix some clang warnings

- Use using instead of typedef
- User member initialization
- Use nullptr
- Do not use else after return
- Delete pointers unconditionally
- Fix some integer conversion warnings
- Use auto for new/casts to avoid type name repetition
- Use = default for trivial destructors

Task-number: QTCREATORBUG-23248
Change-Id: I0a7465d3aa200b5c862bec82636d2d22ddf8297b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Friedemann Kleint
2019-11-25 14:23:33 +01:00
parent f9c1795d3b
commit b96bf86f18
14 changed files with 41 additions and 52 deletions

View File

@@ -92,7 +92,7 @@ void FormEditorStack::add(const EditorData &data)
// Since we have 1 pixel splitters we enforce no frame
// on the content widget
if (QFrame *frame = qobject_cast<QFrame*>(data.widgetHost))
if (auto frame = qobject_cast<QFrame*>(data.widgetHost))
frame->setFrameStyle(QFrame::NoFrame);
}
@@ -122,7 +122,7 @@ EditorData FormEditorStack::activeEditor() const
if (index >= 0)
return m_formEditors.at(index);
}
return EditorData();
return {};
}
SharedTools::WidgetHost *FormEditorStack::formWindowEditorForFormWindow(const QDesignerFormWindowInterface *fw) const
@@ -173,7 +173,7 @@ void FormEditorStack::formSizeChanged(int w, int h)
// Handle main container resize.
if (Designer::Constants::Internal::debug)
qDebug() << Q_FUNC_INFO << w << h;
if (const SharedTools::WidgetHost *wh = qobject_cast<const SharedTools::WidgetHost *>(sender())) {
if (auto wh = qobject_cast<const SharedTools::WidgetHost *>(sender())) {
wh->formWindow()->setDirty(true);
static const QString geometry = "geometry";
m_designerCore->propertyEditor()->setPropertyValue(geometry, QRect(0,0,w,h) );