diff --git a/2d-list-view/environment.yaml b/2d-list-view/environment.yaml index e1926f0..d325e38 100644 --- a/2d-list-view/environment.yaml +++ b/2d-list-view/environment.yaml @@ -28,7 +28,7 @@ dependencies: - nss=3.46=h39b4b1f_0 - openssl=1.1.1c=h01d97ff_0 - pip=19.2.2=py27_0 - - pyside2=5.12.4=py27h9cca949_0 + - PySide6=5.12.4=py27h9cca949_0 - python=2.7.15=h8f8e585_6 - qt=5.12.5=h1b46049_0 - readline=7.0=h1de35cc_5 diff --git a/2d-list-view/main.py b/2d-list-view/main.py index de4fe76..30599e3 100644 --- a/2d-list-view/main.py +++ b/2d-list-view/main.py @@ -4,9 +4,9 @@ import time import random -from PySide2 import QtCore as qtc -from PySide2 import QtGui as qtg -from PySide2 import QtQml as qml +from PySide6 import QtCore as qtc +from PySide6 import QtGui as qtg +from PySide6 import QtQml as qml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/README.md b/README.md index ee075d0..534d8a8 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# pyside2-qml-examples +# PySide6-qml-examples -[![license](https://img.shields.io/github/license/vvzen/pyside2-qml-examples)](https://github.com/vvzen/pyside2-qml-examples/blob/main/LICENSE) +[![license](https://img.shields.io/github/license/vvzen/PySide6-qml-examples)](https://github.com/vvzen/PySide6-qml-examples/blob/main/LICENSE) ![Generic badge](https://img.shields.io/badge/status-wip-yellow.svg) -There are very few examples online of **QML** using **PySide2** as a backend, so I decided to start collecting some simple ones while I learn this technology. +There are very few examples online of **QML** using **PySide6** as a backend, so I decided to start collecting some simple ones while I learn this technology. I think QML is a great idea that clearly separates logic from presentation, so hopefully people in VFX and Animation will start using it (instead of handling all of the .ui to .py autogenerated code madness). I've read online about QML from people in VFX and there is a certain sentiment that it's only for creating fancy "mobile-like" experiences. @@ -20,7 +20,7 @@ In my humble opinion, they really aren't getting the big picture... - You can create components that define a certain look/behaviour and reuse them (buttons but even lists views, menu bars, etc..) - Yes, It's still a little bit of a PITA to use QML inside Nuke/Maya/Houdini, but things are slowly changing. -In the meantime, nothing prevents you from doing standalone apps in QML, as long as you've got ways to properly package/source PySide2 (rez, conda, pip, tcl-modules, etc..) +In the meantime, nothing prevents you from doing standalone apps in QML, as long as you've got ways to properly package/source PySide6 (rez, conda, pip, tcl-modules, etc..) - If you're crazy enough and you realize in the mid of a project that you need more performance for the backend, you could potentially rewrite it in C++ and leave the frontend almost untouched @@ -55,7 +55,7 @@ $ qmlscene main.qml # Examples -Note: The following examples have been tested under `python3.7` and `pyside2=5.13.2`. +Note: The following examples have been tested under `python3.7` and `PySide6=5.13.2`. They should also work under `python2.7`, but I haven't tested that ## list-view @@ -90,7 +90,7 @@ For now, I think that those would be nice: ## Readme & docs - Improve the wiki! (which is empty, at the moment) - Improve the readme -- Add relevant links where people can learn more about PySide2 + QML +- Add relevant links where people can learn more about PySide6 + QML - Start an issue to discuss about something relevant to everybody (IE: how the heck can I use this workflow in Nuke?) ## Code diff --git a/launcher-app/main.py b/launcher-app/main.py index 6f99ef8..2501143 100644 --- a/launcher-app/main.py +++ b/launcher-app/main.py @@ -3,9 +3,9 @@ import os import sys -from PySide2 import QtCore as qtc -from PySide2 import QtGui as qtg -from PySide2 import QtQml as qml +from PySide6 import QtCore as qtc +from PySide6 import QtGui as qtg +from PySide6 import QtQml as qml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/list-view/environment.yaml b/list-view/environment.yaml index d393e78..d2eb277 100644 --- a/list-view/environment.yaml +++ b/list-view/environment.yaml @@ -40,7 +40,7 @@ dependencies: - py==1.7.0 - pyinstaller==3.4 - pyparsing==2.3.0 - - pyside2==5.12.0 + - PySide6==5.12.0 - pytest==4.2.0 - python-dateutil==2.7.5 - requests==2.21.0 diff --git a/list-view/main.py b/list-view/main.py index f56d355..d0b0d4c 100644 --- a/list-view/main.py +++ b/list-view/main.py @@ -1,9 +1,9 @@ import os import sys -from PySide2 import QtCore as qtc -from PySide2 import QtGui as qtg -from PySide2 import QtQml as qml +from PySide6 import QtCore as qtc +from PySide6 import QtGui as qtg +from PySide6 import QtQml as qml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) @@ -82,7 +82,7 @@ def main(): if not engine.rootObjects(): return -1 - return app.exec_() + return app.exec() if __name__ == '__main__': diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..3af6e7e --- /dev/null +++ b/poetry.lock @@ -0,0 +1,54 @@ +[[package]] +name = "pyside6" +version = "6.4.0.1" +description = "Python bindings for the Qt cross-platform application and UI framework" +category = "main" +optional = false +python-versions = "<3.12,>=3.7" + +[package.dependencies] +PySide6-Addons = "6.4.0.1" +PySide6-Essentials = "6.4.0.1" +shiboken6 = "6.4.0.1" + +[[package]] +name = "pyside6-addons" +version = "6.4.0.1" +description = "Python bindings for the Qt cross-platform application and UI framework (Addons)" +category = "main" +optional = false +python-versions = "<3.12,>=3.7" + +[package.dependencies] +PySide6-Essentials = "6.4.0.1" +shiboken6 = "6.4.0.1" + +[[package]] +name = "pyside6-essentials" +version = "6.4.0.1" +description = "Python bindings for the Qt cross-platform application and UI framework (Essentials)" +category = "main" +optional = false +python-versions = "<3.12,>=3.7" + +[package.dependencies] +shiboken6 = "6.4.0.1" + +[[package]] +name = "shiboken6" +version = "6.4.0.1" +description = "Python/C++ bindings helper module" +category = "main" +optional = false +python-versions = "<3.12,>=3.7" + +[metadata] +lock-version = "1.1" +python-versions = ">=3.10,<3.12" +content-hash = "4d2ce2d12e0f90bb0d58282c18723465d637d0860d4c563f998e543d49fed66e" + +[metadata.files] +pyside6 = [] +pyside6-addons = [] +pyside6-essentials = [] +shiboken6 = [] diff --git a/publisher-app/main.py b/publisher-app/main.py index ece7c7e..90e3bff 100644 --- a/publisher-app/main.py +++ b/publisher-app/main.py @@ -7,9 +7,9 @@ import time import pprint -from PySide2 import QtCore as qtc -from PySide2 import QtGui as qtg -from PySide2 import QtQml as qml +from PySide6 import QtCore as qtc +from PySide6 import QtGui as qtg +from PySide6 import QtQml as qml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..86d061c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,16 @@ +[tool.poetry] +name = "PySide6-qml-examples" +version = "0.1.0" +description = "" +authors = ["Your Name "] +license = "MIT" + +[tool.poetry.dependencies] +python = ">=3.10,<3.12" +PySide6 = "^6.4.0.1" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api"