diff options
Diffstat (limited to 'src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp')
-rw-r--r-- | src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp b/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp index 8177927a8b..f1f51c0582 100644 --- a/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp +++ b/src/gui/doc/snippets/code/src_gui_kernel_qapplication.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -89,7 +99,8 @@ QSize MyWidget::sizeHint() const //! [4] void showAllHiddenTopLevelWidgets() { - foreach (QWidget *widget, QApplication::topLevelWidgets()) { + const auto topLevelWidgets = QApplication::topLevelWidgets(); + for (QWidget *widget : topLevelWidgets) { if (widget->isHidden()) widget->show(); } @@ -100,7 +111,8 @@ void showAllHiddenTopLevelWidgets() //! [5] void updateAllWidgets() { - foreach (QWidget *widget, QApplication::allWidgets()) + const auto topLevelWidgets = QApplication::topLevelWidgets(); + for (QWidget *widget : topLevelWidgets) widget->update(); } //! [5] |