summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qformlayout.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-03-01 10:18:56 -0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 04:34:15 +0100
commit380de7f8e70cfa5f335a065e446dc707d416c1a6 (patch)
tree98cb25d8979ae39db64703e4adc1f5b3d08df291 /src/widgets/kernel/qformlayout.cpp
parent7e872de76ee0591d4fea72f4ef07637ca5f7ca0d (diff)
Fix use uninitialized, detected by GCC 4.8
If the widget \a field is not present on this form, getWidgetPosition might not fill in the role variable. GCC is correct. qformlayout.cpp:1690:19: error: ‘role’ may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: Ia67991a71e8f1ceacb9d6370c7028c454ef630c6 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/kernel/qformlayout.cpp')
-rw-r--r--src/widgets/kernel/qformlayout.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp
index c1d3e95e7a..239e1ce1e2 100644
--- a/src/widgets/kernel/qformlayout.cpp
+++ b/src/widgets/kernel/qformlayout.cpp
@@ -1683,7 +1683,7 @@ QWidget *QFormLayout::labelForField(QWidget *field) const
Q_D(const QFormLayout);
int row;
- ItemRole role;
+ ItemRole role = LabelRole;
getWidgetPosition(field, &row, &role);