forked from qt-creator/qt-creator
Fix use of variable before initialization
That's what you get for shadowing a variable... The "childItem" variable on the second part of the foreach refers to one declared on the first part, which is uninitialized. Found by ICC 14.0: graphicalnodeinstance.cpp(300): warning #592: variable "childItem" is used before its value is set Change-Id: I9079a428eda90f4bb06f9ccd1adf836fee119133 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Marco Bubke <marco.bubke@digia.com>
This commit is contained in:
@@ -292,12 +292,12 @@ int GraphicalNodeInstance::penWidth() const
|
||||
}
|
||||
|
||||
|
||||
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *childItem) const
|
||||
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *item) const
|
||||
{
|
||||
QList<ServerNodeInstance> instanceList;
|
||||
|
||||
if (childItem) {
|
||||
foreach (QQuickItem *childItem, childItem->childItems())
|
||||
if (item) {
|
||||
foreach (QQuickItem *childItem, item->childItems())
|
||||
{
|
||||
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
|
||||
instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
|
||||
|
@@ -69,7 +69,7 @@ protected:
|
||||
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
|
||||
void resetHorizontal();
|
||||
void resetVertical();
|
||||
QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const;
|
||||
QList<ServerNodeInstance> childItemsForChild(QQuickItem *item) const;
|
||||
void refresh();
|
||||
static bool anyItemHasContent(QQuickItem *quickItem);
|
||||
static bool childItemsHaveContent(QQuickItem *quickItem);
|
||||
|
Reference in New Issue
Block a user