uic: Fix remaining clang warnings

Fix remaining nullptr and member initialization issues which
Qt Creator did not catch.

Change-Id: If5492259aea9849c790f00809a27f4c78b446b9b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Friedemann Kleint 2019-06-27 15:17:29 +02:00
parent 6301d5e51b
commit 94bee657c1
5 changed files with 13 additions and 18 deletions

View File

@ -69,7 +69,7 @@ static inline QString moduleHeader(const QString &module, const QString &header)
namespace CPP {
WriteIncludes::WriteIncludes(Uic *uic)
: m_uic(uic), m_output(uic->output()), m_laidOut(false)
: m_uic(uic), m_output(uic->output())
{
// When possible (no namespace) use the "QtModule/QClass" convention
// and create a re-mapping of the old header "qclass.h" to it. Do not do this

View File

@ -101,7 +101,7 @@ private:
StringMap m_classToHeader;
StringMap m_oldHeaderToNewHeader;
bool m_laidOut;
bool m_laidOut = false;
};
} // namespace CPP

View File

@ -455,22 +455,17 @@ WriteInitialization::WriteInitialization(Uic *uic) :
m_driver(uic->driver()), m_output(uic->output()), m_option(uic->option()),
m_indent(m_option.indent + m_option.indent),
m_dindent(m_indent + m_option.indent),
m_stdsetdef(true),
m_layoutMarginType(TopLevelMargin),
m_mainFormUsedInRetranslateUi(false),
m_delayedOut(&m_delayedInitialization, QIODevice::WriteOnly),
m_refreshOut(&m_refreshInitialization, QIODevice::WriteOnly),
m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly),
m_layoutWidget(false),
m_firstThemeIcon(true)
m_actionOut(&m_delayedActionInitialization, QIODevice::WriteOnly)
{
}
void WriteInitialization::acceptUI(DomUI *node)
{
m_actionGroupChain.push(0);
m_widgetChain.push(0);
m_layoutChain.push(0);
m_actionGroupChain.push(nullptr);
m_widgetChain.push(nullptr);
m_layoutChain.push(nullptr);
acceptLayoutDefault(node->elementLayoutDefault());
acceptLayoutFunction(node->elementLayoutFunction());

View File

@ -244,7 +244,7 @@ private:
const Option &m_option;
QString m_indent;
QString m_dindent;
bool m_stdsetdef;
bool m_stdsetdef = true;
struct Buddy
{
@ -294,11 +294,11 @@ private:
// layout defaults
LayoutDefaultHandler m_LayoutDefaultHandler;
int m_layoutMarginType;
int m_layoutMarginType = TopLevelMargin;
QString m_generatedClass;
QString m_mainFormVarName;
bool m_mainFormUsedInRetranslateUi;
bool m_mainFormUsedInRetranslateUi = false;
QString m_delayedInitialization;
QTextStream m_delayedOut;
@ -309,8 +309,8 @@ private:
QString m_delayedActionInitialization;
QTextStream m_actionOut;
bool m_layoutWidget;
bool m_firstThemeIcon;
bool m_layoutWidget = false;
bool m_firstThemeIcon = true;
};
} // namespace CPP

View File

@ -95,7 +95,7 @@ bool CustomWidgetsInfo::extendsOneOf(const QString &classNameIn,
bool CustomWidgetsInfo::isCustomWidgetContainer(const QString &className) const
{
if (const DomCustomWidget *dcw = m_customWidgets.value(className, 0))
if (const DomCustomWidget *dcw = m_customWidgets.value(className, nullptr))
if (dcw->hasElementContainer())
return dcw->elementContainer() != 0;
return false;
@ -111,7 +111,7 @@ QString CustomWidgetsInfo::realClassName(const QString &className) const
QString CustomWidgetsInfo::customWidgetAddPageMethod(const QString &name) const
{
if (DomCustomWidget *dcw = m_customWidgets.value(name, 0))
if (DomCustomWidget *dcw = m_customWidgets.value(name, nullptr))
return dcw->elementAddPageMethod();
return QString();
}