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. Pick-to: 6.5 6.6 Change-Id: I1422b04fc1fdbfc7248de577884aabfb539f3f4b Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
70b57c943a
commit
41c8d215f2
@ -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