aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py')
-rw-r--r--examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py56
1 files changed, 10 insertions, 46 deletions
diff --git a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py
index c0e3266ce..c9dfcc730 100644
--- a/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py
+++ b/examples/widgets/layouts/dynamiclayouts/dynamiclayouts.py
@@ -1,44 +1,6 @@
-
-############################################################################
-##
-## Copyright (C) 2013 Riverbank Computing Limited.
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: http://www.qt.io/licensing/
-##
-## This file is part of the Qt for Python examples of the Qt Toolkit.
-##
-## $QT_BEGIN_LICENSE:BSD$
-## 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
-## met:
-## * Redistributions of source code must retain the above copyright
-## notice, this list of conditions and the following disclaimer.
-## * Redistributions in binary form must reproduce the above copyright
-## notice, this list of conditions and the following disclaimer in
-## the documentation and/or other materials provided with the
-## distribution.
-## * Neither the name of The Qt Company Ltd nor the names of its
-## contributors may be used to endorse or promote products derived
-## from this software without specific prior written permission.
-##
-##
-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
+# Copyright (C) 2013 Riverbank Computing Limited.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
"""PySide6 port of the widgets/layouts/dynamiclayouts example from Qt v5.x"""
@@ -88,7 +50,7 @@ class Dialog(QDialog):
self._main_layout.setSizeConstraint(QLayout.SetNoConstraint)
self.setMinimumSize(0, 0)
- orientation = Qt.Orientation(int(self._buttons_orientation_combo_box.itemData(index)))
+ orientation = Qt.Orientation(self._buttons_orientation_combo_box.itemData(index))
if orientation == self._button_box.orientation():
return
@@ -112,8 +74,8 @@ class Dialog(QDialog):
def show_help(self):
QMessageBox.information(self, "Dynamic Layouts Help",
- "This example shows how to change layouts "
- "dynamically.")
+ "This example shows how to change layouts "
+ "dynamically.")
def create_rotable_group_box(self):
self._rotable_group_box = QGroupBox("Rotable Widgets")
@@ -140,7 +102,8 @@ class Dialog(QDialog):
buttons_orientation_combo_box = QComboBox()
buttons_orientation_combo_box.addItem("Horizontal", Qt.Horizontal)
buttons_orientation_combo_box.addItem("Vertical", Qt.Vertical)
- buttons_orientation_combo_box.currentIndexChanged[int].connect(self.buttons_orientation_changed)
+ buttons_orientation_combo_box.currentIndexChanged[int].connect(
+ self.buttons_orientation_changed)
self._buttons_orientation_combo_box = buttons_orientation_combo_box
@@ -155,7 +118,8 @@ class Dialog(QDialog):
close_button = self._button_box.addButton(QDialogButtonBox.Close)
help_button = self._button_box.addButton(QDialogButtonBox.Help)
- rotate_widgets_button = self._button_box.addButton("Rotate &Widgets", QDialogButtonBox.ActionRole)
+ rotate_widgets_button = self._button_box.addButton(
+ "Rotate &Widgets", QDialogButtonBox.ActionRole)
rotate_widgets_button.clicked.connect(self.rotate_widgets)
close_button.clicked.connect(self.close)