tst_QSplitter: fix compiler warning
QLabel *l is declared uninitialized, assigned in a for loop. The last object is deleted for testing purposes. This leads to a false compiler warning about deleting a potentially unintialized pointer. => initialize with nullptr to silence the warning. Change-Id: I1422b04fc1fdbfc7248de577884aabfb539f3f4b Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 41c8d215f273c048d76c51de4c56cb55c4325c85) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
0ef069956f
commit
9954eb9c50
@ -1032,7 +1032,7 @@ void tst_QSplitter::taskQTBUG_4101_ensureOneNonCollapsedWidget()
|
||||
QFETCH(bool, testingHide);
|
||||
|
||||
MyFriendlySplitter s;
|
||||
QLabel *l;
|
||||
QLabel *l = nullptr;
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
l = new QLabel(QString("Label ") + QChar('A' + i));
|
||||
l->setAlignment(Qt::AlignCenter);
|
||||
|
Loading…
x
Reference in New Issue
Block a user