aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-05-17 18:09:48 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-17 18:31:12 +0000
commit558c8d9d1eccdc55bf130da79fd8431bd3c59554 (patch)
treeb5b282a08c397e6fc657c82ac05efddd01715ca8
parent8e4558d261991d539ddcd929f3d8bd9a37713c62 (diff)
Purge remaining app.exec_()
Add a porting note. Change-Id: I4ccb1dc2a3a5925e55e94e7f3d23b1fb199afe4a Reviewed-by: Christian Tismer <tismer@stackless.com> (cherry picked from commit ecae80eefce191aae2ee11b6fdf71ed3d48f0b83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/pyside6/doc/deployment-briefcase.rst2
-rw-r--r--sources/pyside6/doc/deployment-cxfreeze.rst2
-rw-r--r--sources/pyside6/doc/deployment-fbs.rst2
-rw-r--r--sources/pyside6/doc/deployment-pyinstaller.rst2
-rw-r--r--sources/pyside6/doc/porting_from2.rst3
-rw-r--r--sources/pyside6/doc/quickstart.rst2
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst4
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/dialog.rst4
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/qml.rst2
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/tablewidget.rst2
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/treewidget.rst2
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/uifiles.rst4
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgets.rst4
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py2
-rw-r--r--sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst6
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/expenses.rst2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/main_snake_prop.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py2
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter1/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter2/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py2
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/chapter3/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py2
-rw-r--r--sources/pyside6/doc/tutorials/portingguide/index.rst2
-rw-r--r--sources/pyside6/doc/tutorials/qmlapp/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/qmlintegration/main.py2
-rw-r--r--sources/pyside6/doc/tutorials/qmlsqlintegration/main.py2
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_429.py2
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_430.py2
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_668.py2
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_834.py2
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_844.py2
-rw-r--r--tools/snippets_translate/converter.py2
-rw-r--r--tools/uic_test.py2
48 files changed, 56 insertions, 53 deletions
diff --git a/sources/pyside6/doc/deployment-briefcase.rst b/sources/pyside6/doc/deployment-briefcase.rst
index 471ae6251..95aee1432 100644
--- a/sources/pyside6/doc/deployment-briefcase.rst
+++ b/sources/pyside6/doc/deployment-briefcase.rst
@@ -116,7 +116,7 @@ Content of `__main__.py`::
widget.resize(800, 600)
widget.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Content of `app.py`::
diff --git a/sources/pyside6/doc/deployment-cxfreeze.rst b/sources/pyside6/doc/deployment-cxfreeze.rst
index 5bb249834..681dcf315 100644
--- a/sources/pyside6/doc/deployment-cxfreeze.rst
+++ b/sources/pyside6/doc/deployment-cxfreeze.rst
@@ -76,7 +76,7 @@ Now, consider the following simple script, named `hello.py`::
widget.resize(800, 600)
widget.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Using `cxfreeze` executable
diff --git a/sources/pyside6/doc/deployment-fbs.rst b/sources/pyside6/doc/deployment-fbs.rst
index 27f4850b3..c2a2397d2 100644
--- a/sources/pyside6/doc/deployment-fbs.rst
+++ b/sources/pyside6/doc/deployment-fbs.rst
@@ -64,7 +64,7 @@ The `main` file is in the `python` directory, and its default content is::
window = QMainWindow()
window.resize(250, 150)
window.show()
- exit_code = appctxt.app.exec_() # 2. Invoke appctxt.app.exec_()
+ exit_code = appctxt.app.exec() # 2. Invoke appctxt.app.exec()
sys.exit(exit_code)
This example shows an empty `QMainWindow`. You can run it using the following command::
diff --git a/sources/pyside6/doc/deployment-pyinstaller.rst b/sources/pyside6/doc/deployment-pyinstaller.rst
index 6589c614d..eb900bd74 100644
--- a/sources/pyside6/doc/deployment-pyinstaller.rst
+++ b/sources/pyside6/doc/deployment-pyinstaller.rst
@@ -99,7 +99,7 @@ Now, consider the following script, named `hello.py`::
widget.resize(800, 600)
widget.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Since it has a UI, you use the `--windowed` option.
diff --git a/sources/pyside6/doc/porting_from2.rst b/sources/pyside6/doc/porting_from2.rst
index b94cada92..ac4474df0 100644
--- a/sources/pyside6/doc/porting_from2.rst
+++ b/sources/pyside6/doc/porting_from2.rst
@@ -89,6 +89,9 @@ accordingly. For example:
* ``QRegExp`` has been replaced by ``QRegularExpression``.
* ``QWidget.mapToGlobal()`` and ``QWidget.mapFromGlobal()`` now also accept
and return ``QPointF``.
+ * Functions named ``exec_`` (classes ``QCoreApplication``, ``QDialog``,
+ ``QEventLoop``) have been renamed to ``exec`` which became possible
+ in Python 3.
More information can be found in the
`Porting to Qt 6 <https://doc.qt.io/qt-6/portingguide.html>`_ Guide
diff --git a/sources/pyside6/doc/quickstart.rst b/sources/pyside6/doc/quickstart.rst
index 8cdd46053..3764e8269 100644
--- a/sources/pyside6/doc/quickstart.rst
+++ b/sources/pyside6/doc/quickstart.rst
@@ -110,7 +110,7 @@ guide you through the development process:
widget.resize(800, 600)
widget.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Run your example by writing the following command: :command:`python hello_world.py`.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst b/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst
index e81e4964a..894060e98 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/clickablebutton.rst
@@ -65,7 +65,7 @@ Finally, we show the button and start the Qt main loop:
# Show the button
button.show()
# Run the main Qt loop
- app.exec_()
+ app.exec()
Here is the complete code for this example:
::
@@ -87,4 +87,4 @@ Here is the complete code for this example:
button.clicked.connect(say_hello)
button.show()
# Run the main Qt loop
- app.exec_()
+ app.exec()
diff --git a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
index da3b336cd..577db27d9 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/dialog.rst
@@ -28,7 +28,7 @@ tutorial, but you can use this stub as is if you need to:
form = Form()
form.show()
# Run the main Qt loop
- sys.exit(app.exec_())
+ sys.exit(app.exec())
The imports aren't new to you, the same for the creation of the
`QApplication` and the execution of the Qt main loop.
@@ -138,4 +138,4 @@ Here is the complete code for this tutorial:
form = Form()
form.show()
# Run the main Qt loop
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/basictutorial/qml.rst b/sources/pyside6/doc/tutorials/basictutorial/qml.rst
index 15fd1da75..0ea346069 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/qml.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/qml.rst
@@ -54,7 +54,7 @@ Let's call it `main.py`:
view.setSource(url)
view.show()
- app.exec_()
+ app.exec()
If you are already familiar with PySide6 and have followed our
tutorials, you have already seen much of this code.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/tablewidget.rst b/sources/pyside6/doc/tutorials/basictutorial/tablewidget.rst
index a041e4116..5c04529fd 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/tablewidget.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/tablewidget.rst
@@ -87,7 +87,7 @@ a ``QTableView``, but that is not in the scope of this tutorial.
.. code-block:: python
table.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
The final application will look like this:
diff --git a/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst b/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst
index 26f29e1f0..b286de507 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/treewidget.rst
@@ -69,7 +69,7 @@ information in trees. You can also create a data model and display it using a
.. code-block:: python
tree.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
The final application will look like this:
diff --git a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
index fa483a302..579fc5ebb 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/uifiles.rst
@@ -112,7 +112,7 @@ To understand the idea, let's take a look at the whole code:
window = MainWindow()
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
What is inside the *if* statement is already known from the previous
examples, and our new basic class contains only two new lines
@@ -177,7 +177,7 @@ The complete code of this example looks like this:
sys.exit(-1)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Then to execute it we just need to run the following on a
command prompt:
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgets.rst b/sources/pyside6/doc/tutorials/basictutorial/widgets.rst
index d86ba2623..89bd23f63 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/widgets.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgets.rst
@@ -14,7 +14,7 @@ Here is a simple example of a Hello World application in PySide6:
app = QApplication(sys.argv)
label = QLabel("Hello World!")
label.show()
- app.exec_()
+ app.exec()
For a widget application using PySide6, you must always start by
@@ -40,6 +40,6 @@ After the creation of the application object, we have created a
.. note:: After creating the label, we call `show()` on it.
-Finally, we call `app.exec_()` to enter the Qt main loop and start
+Finally, we call `app.exec()` to enter the Qt main loop and start
to execute the Qt code. In reality, it is only here where the label
is shown, but this can be ignored for now.
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
index 69caf177f..9db878b0c 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.py
@@ -92,4 +92,4 @@ if __name__ == "__main__":
_style = f.read()
app.setStyleSheet(_style)
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst
index 6c83c1fbf..a4e937a2e 100644
--- a/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst
+++ b/sources/pyside6/doc/tutorials/basictutorial/widgetstyling.rst
@@ -21,7 +21,7 @@ to each component. As an example, look at the following simple snippet:
w = QLabel("This is a placeholder text")
w.setAlignment(Qt.AlignCenter)
w.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
When you execute this code, you will see a simple `QLabel` aligned at the
center, and with a placeholder text.
@@ -53,7 +53,7 @@ so let's see how does the code look like with these changes:
font-size: 18px;
""")
w.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Now when you run the code, notice that the `QLabel` looks different with your
custom style:
@@ -130,7 +130,7 @@ the file and using the `QApplication.setStyleSheet(str)` function:
_style = f.read()
app.setStyleSheet(_style)
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Having a general `qss` file allows you to decouple the styling aspects of
the code, without mixing it in the middle of the general functionality, and you
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
index 5dac460a5..32aaea1d6 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize3/main.py
@@ -84,5 +84,5 @@ if __name__ == "__main__":
window = MainWindow()
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
index ffb4d00b0..b4d787993 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize4/main.py
@@ -86,5 +86,5 @@ if __name__ == "__main__":
window = MainWindow(widget)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
index ffb4d00b0..b4d787993 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize5/main.py
@@ -86,5 +86,5 @@ if __name__ == "__main__":
window = MainWindow(widget)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
index 3402ff856..e4466f7ca 100644
--- a/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
+++ b/sources/pyside6/doc/tutorials/datavisualize/datavisualize6/main.py
@@ -89,4 +89,4 @@ if __name__ == "__main__":
window = MainWindow(widget)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/expenses.rst b/sources/pyside6/doc/tutorials/expenses/expenses.rst
index 2aa3fb459..aa672d781 100644
--- a/sources/pyside6/doc/tutorials/expenses/expenses.rst
+++ b/sources/pyside6/doc/tutorials/expenses/expenses.rst
@@ -37,7 +37,7 @@ code block.
if __name__ == "__main__":
app = QApplication([])
# ...
- sys.exit(app.exec_())
+ sys.exit(app.exec())
Now, to start the development, create an empty window called `MainWindow`.
You could do that by defining a class that inherits from `QMainWindow`.
diff --git a/sources/pyside6/doc/tutorials/expenses/main.py b/sources/pyside6/doc/tutorials/expenses/main.py
index 4dcaedb50..76eea3440 100644
--- a/sources/pyside6/doc/tutorials/expenses/main.py
+++ b/sources/pyside6/doc/tutorials/expenses/main.py
@@ -204,4 +204,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py b/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
index 92ad2b92c..d529391b5 100644
--- a/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
+++ b/sources/pyside6/doc/tutorials/expenses/main_snake_prop.py
@@ -207,4 +207,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
index efbbc59fc..c4dc9b3f6 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/01-expenses.py
@@ -56,4 +56,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
index 783283d4f..5899ae798 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/02-expenses.py
@@ -68,4 +68,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
index bebf0b3ce..d0ecd6844 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/03-expenses.py
@@ -75,4 +75,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
index a9a4c10a1..7f7df478a 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/04-expenses.py
@@ -87,4 +87,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
index 3b22c2631..b88c9a7d8 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/05-expenses.py
@@ -115,4 +115,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
index 5e6bcc0e9..f65ede982 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/06-expenses.py
@@ -135,4 +135,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
index aa7ee6a3a..cdae2a847 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/07-expenses.py
@@ -162,4 +162,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
index 0c5eb7c61..907ee253b 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/08-expenses.py
@@ -175,4 +175,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
index 30e1d7f3f..7c4f7b252 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/09-expenses.py
@@ -182,4 +182,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py b/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
index 7e33f6acb..1ad6c3743 100644
--- a/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
+++ b/sources/pyside6/doc/tutorials/expenses/steps/10-expenses.py
@@ -204,4 +204,4 @@ if __name__ == "__main__":
window.show()
# Execute application
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
index 5b42a61a1..c60ff6839 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter1/main.py
@@ -56,4 +56,4 @@ if __name__ == "__main__":
table_view.setModel(model)
table_view.resize(800, 600)
table_view.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
index c9c907f90..cf023fb35 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter2/main.py
@@ -60,4 +60,4 @@ if __name__ == "__main__":
table.resize(800, 600)
table.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
index 675f8032b..edaf5cf60 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/main-old.py
@@ -49,4 +49,4 @@ if __name__ == "__main__":
window.resize(800, 600)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py b/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
index e957869ac..3994a66b4 100644
--- a/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
+++ b/sources/pyside6/doc/tutorials/portingguide/chapter3/main.py
@@ -50,4 +50,4 @@ if __name__ == "__main__":
window.resize(800, 600)
window.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py b/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
index 81b63b7ea..f29cbd9ba 100644
--- a/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
+++ b/sources/pyside6/doc/tutorials/portingguide/hello_world_ex.py
@@ -73,4 +73,4 @@ if __name__ == "__main__":
widget.resize(800, 600)
widget.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/portingguide/index.rst b/sources/pyside6/doc/tutorials/portingguide/index.rst
index 12f76d3fc..bc7e6dee5 100644
--- a/sources/pyside6/doc/tutorials/portingguide/index.rst
+++ b/sources/pyside6/doc/tutorials/portingguide/index.rst
@@ -93,7 +93,7 @@ follow the guidelines outlined in the
app = QApplication(sys.argv)
label = QLabel("Hello World")
label.show()
- sys.exit(app.exec_())
+ sys.exit(app.exec())
.. note:: Qt provides classes that are meant to manage
the application-specific requirements depending on
diff --git a/sources/pyside6/doc/tutorials/qmlapp/main.py b/sources/pyside6/doc/tutorials/qmlapp/main.py
index c1c941835..c85b12ad7 100644
--- a/sources/pyside6/doc/tutorials/qmlapp/main.py
+++ b/sources/pyside6/doc/tutorials/qmlapp/main.py
@@ -84,5 +84,5 @@ if __name__ == '__main__':
view.show()
#execute and cleanup
- app.exec_()
+ app.exec()
del view
diff --git a/sources/pyside6/doc/tutorials/qmlintegration/main.py b/sources/pyside6/doc/tutorials/qmlintegration/main.py
index 24a801851..16fbee999 100644
--- a/sources/pyside6/doc/tutorials/qmlintegration/main.py
+++ b/sources/pyside6/doc/tutorials/qmlintegration/main.py
@@ -111,4 +111,4 @@ if __name__ == '__main__':
if not engine.rootObjects():
sys.exit(-1)
- sys.exit(app.exec_())
+ sys.exit(app.exec())
diff --git a/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
index 03050ff32..ac295bda0 100644
--- a/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
+++ b/sources/pyside6/doc/tutorials/qmlsqlintegration/main.py
@@ -83,4 +83,4 @@ if __name__ == "__main__":
engine.rootContext().setContextProperty("chat_model", sql_conversation_model)
engine.load(QUrl("chat.qml"))
- app.exec_()
+ app.exec()
diff --git a/sources/pyside6/tests/QtWidgets/bug_429.py b/sources/pyside6/tests/QtWidgets/bug_429.py
index 5a004e742..5041acb4e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_429.py
+++ b/sources/pyside6/tests/QtWidgets/bug_429.py
@@ -44,4 +44,4 @@ scene = QGraphicsScene()
label = QLabel("hello world")
label.show()
QTimer.singleShot(0, label.close)
-exit(app.exec_())
+exit(app.exec())
diff --git a/sources/pyside6/tests/QtWidgets/bug_430.py b/sources/pyside6/tests/QtWidgets/bug_430.py
index 0d3e3a09a..b6cf49252 100644
--- a/sources/pyside6/tests/QtWidgets/bug_430.py
+++ b/sources/pyside6/tests/QtWidgets/bug_430.py
@@ -49,4 +49,4 @@ model = ListModel()
v = QListView()
v.setModel(model)
QTimer.singleShot(0, v.close)
-app.exec_()
+app.exec()
diff --git a/sources/pyside6/tests/QtWidgets/bug_668.py b/sources/pyside6/tests/QtWidgets/bug_668.py
index 09456756c..1f0d49ada 100644
--- a/sources/pyside6/tests/QtWidgets/bug_668.py
+++ b/sources/pyside6/tests/QtWidgets/bug_668.py
@@ -58,4 +58,4 @@ app = QApplication([])
m = A()
m.show()
QTimer.singleShot(0, m.close)
-app.exec_()
+app.exec()
diff --git a/sources/pyside6/tests/QtWidgets/bug_834.py b/sources/pyside6/tests/QtWidgets/bug_834.py
index a8a6ab107..b01049dce 100644
--- a/sources/pyside6/tests/QtWidgets/bug_834.py
+++ b/sources/pyside6/tests/QtWidgets/bug_834.py
@@ -55,4 +55,4 @@ window.tabifyDockWidget(dock1, dock2)
window.show()
QTimer.singleShot(0, window.close)
-app.exec_()
+app.exec()
diff --git a/sources/pyside6/tests/QtWidgets/bug_844.py b/sources/pyside6/tests/QtWidgets/bug_844.py
index e6167dfc6..fdf045dba 100644
--- a/sources/pyside6/tests/QtWidgets/bug_844.py
+++ b/sources/pyside6/tests/QtWidgets/bug_844.py
@@ -53,4 +53,4 @@ key_listener = QtKeyPressListener(app)
w = QLabel('Hello')
w.show()
QTimer.singleShot(0, w.close)
-app.exec_()
+app.exec()
diff --git a/tools/snippets_translate/converter.py b/tools/snippets_translate/converter.py
index e5193f598..8eeaee551 100644
--- a/tools/snippets_translate/converter.py
+++ b/tools/snippets_translate/converter.py
@@ -165,7 +165,7 @@ def snippet_translate(x):
# Special case for 'return app.exec()'
if x.strip().startswith("return app.exec"):
- return x.replace("return app.exec()", "sys.exit(app.exec_())")
+ return x.replace("return app.exec()", "sys.exit(app.exec())")
# Handle includes -> import
if x.strip().startswith("#include"):
diff --git a/tools/uic_test.py b/tools/uic_test.py
index 1d1a4c580..5f8a786a9 100644
--- a/tools/uic_test.py
+++ b/tools/uic_test.py
@@ -96,7 +96,7 @@ def test_file(file: str, uic: bool=False) -> bool:
widget = {klass}()
ui.setupUi(widget)
widget.show()
- sys.exit(app.exec_())''')
+ sys.exit(app.exec())''')
py_main.write_text(main_source)
exit_code = subprocess.call([sys.executable, os.fspath(py_main)])
py_main.unlink()