Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1ff717e
Testbed and core changes to support Qt backend operations
johnzhou721 Sep 18, 2025
4d440ca
Addition of a Qt backend source (untested curretnly)
johnzhou721 Sep 18, 2025
2b96810
get rid of unofficial hacks and integrate into core
johnzhou721 Sep 18, 2025
b7504bc
a missed bug
johnzhou721 Sep 18, 2025
49312d0
no-cover trivial parts
johnzhou721 Sep 18, 2025
5f64d70
remove swapfile
johnzhou721 Sep 18, 2025
86e5731
workaround Briefcase's lack of packaging
johnzhou721 Sep 18, 2025
69a660d
fixup pyside6 imoprt hack
johnzhou721 Sep 19, 2025
3028865
fixup to get ready for testbed
johnzhou721 Sep 19, 2025
39349ec
Update button.py
johnzhou721 Sep 19, 2025
d2d0886
Update button.py
johnzhou721 Sep 19, 2025
9236d50
rerun ios ci
johnzhou721 Sep 19, 2025
9255280
Update core/src/toga/__init__.pyi
johnzhou721 Sep 23, 2025
d712512
Cosmetic cleanups
johnzhou721 Sep 26, 2025
7bbecbf
Update qt/src/toga_qt/libs/testing.py
johnzhou721 Sep 26, 2025
027b404
Update qt/src/toga_qt/widgets/activityindicator.py
johnzhou721 Sep 26, 2025
4a0695b
Update qt/src/toga_qt/libs/testing.py
johnzhou721 Sep 26, 2025
f709818
Update qt/src/toga_qt/widgets/activityindicator.py
johnzhou721 Sep 26, 2025
03a21f7
Update qt/src/toga_qt/screens.py
johnzhou721 Sep 26, 2025
e8f15a3
Formatting fixes
johnzhou721 Sep 26, 2025
81a964e
Remove nativeicon, hack action instead
johnzhou721 Sep 26, 2025
bece50b
Platform changes
johnzhou721 Sep 26, 2025
5760f1f
implement colors, a small window fixup
johnzhou721 Sep 28, 2025
7b11df2
multi-app structure setup
johnzhou721 Sep 28, 2025
f1cf4b3
correct the config
johnzhou721 Sep 28, 2025
5ee1ce6
qt testbed working
johnzhou721 Sep 28, 2025
12a9859
fixup
johnzhou721 Sep 28, 2025
220a786
increase timeouts
johnzhou721 Sep 28, 2025
84eb389
restore gtk test
johnzhou721 Sep 28, 2025
8387ade
continued progress.
johnzhou721 Oct 2, 2025
f274bce
a bunch of fixups
johnzhou721 Oct 5, 2025
c906be6
coverage fix
johnzhou721 Oct 5, 2025
7e8ff2e
a missing skip
johnzhou721 Oct 5, 2025
a693640
Update .github/workflows/ci.yml
johnzhou721 Oct 5, 2025
9d12cd3
Update .github/workflows/ci.yml
johnzhou721 Oct 5, 2025
535375c
[desparately] github snow day...
johnzhou721 Oct 5, 2025
9606935
Use system_pysie6
johnzhou721 Oct 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
- "demo"
- "dummy"
- "gtk"
- "qt"
- "iOS"
- "toga"
- "positron"
Expand Down Expand Up @@ -247,6 +248,7 @@ jobs:
briefcase-run-prefix: ""
briefcase-run-args: ""
setup-python: true
testbed-app: testbed

- backend: "macOS-x86_64"
platform: "macOS"
Expand Down Expand Up @@ -444,7 +446,8 @@ jobs:
timeout-minutes: 15
run: |
${{ matrix.briefcase-run-prefix }} \
briefcase run ${{ matrix.platform }} --log --test ${{ matrix.briefcase-run-args }} -- --ci
briefcase run ${{ matrix.platform }} --log --test \
${{ matrix.briefcase-run-args }} --app ${{ matrix.testbed-app }} -- --ci

- name: Upload Logs
uses: actions/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions android/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ def assert_icon_size(self):
assert (icon.getIntrinsicWidth(), icon.getIntrinsicHeight()) == scaled_size
else:
pytest.fail("Icon does not exist")

def assert_taller_than(self, initial_height):
assert self.height > initial_height
1 change: 1 addition & 0 deletions changes/1142.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Toga now provides a Qt backend for KDE-based desktops.
1 change: 1 addition & 0 deletions cocoa/tests_backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class AppProbe(BaseProbe, DialogsMixin):
supports_key_mod3 = True
supports_current_window_assignment = True
supports_dark_mode = True
edit_menu_noop_enabled = False

def __init__(self, app):
super().__init__()
Expand Down
3 changes: 3 additions & 0 deletions cocoa/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,6 @@ def height(self):
assert self.native.bezelStyle == NSBezelStyle.Rounded

return super().height

def assert_taller_than(self, initial_height):
assert self.height > initial_height
2 changes: 2 additions & 0 deletions core/src/toga/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def key(self) -> tuple[tuple[int, int, str], ...]:
COMMANDS: Group #: Default group for user-provided commands
WINDOW: Group #: Window management commands
HELP: Group #: Help commands
SETTINGS: Group #: Preferences menu group for KDE-based apps


Group.APP = Group("*", order=-100)
Expand All @@ -162,6 +163,7 @@ def key(self) -> tuple[tuple[int, int, str], ...]:
Group.COMMANDS = Group("Commands", order=30)
Group.WINDOW = Group("Window", order=90)
Group.HELP = Group("Help", order=100)
Group.SETTINGS = Group("Settings", order=80)


class ActionHandler(Protocol):
Expand Down
1 change: 1 addition & 0 deletions gtk/tests_backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class AppProbe(BaseProbe, DialogsMixin):
# Gtk 3.24.41 ships with Ubuntu 24.04 where present() works on Wayland
supports_current_window_assignment = not (IS_WAYLAND and GTK_VERSION < (3, 24, 41))
supports_dark_mode = True
edit_menu_noop_enabled = False

def __init__(self, app):
super().__init__()
Expand Down
3 changes: 3 additions & 0 deletions gtk/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ def background_color(self):

async def press(self):
self.native.clicked()

def assert_taller_than(self, initial_height):
assert self.height > initial_height
3 changes: 3 additions & 0 deletions iOS/tests_backend/widgets/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ def color(self):
@property
def font(self):
return self.native.titleLabel.font

def assert_taller_than(self, initial_height):
assert self.height > initial_height
11 changes: 11 additions & 0 deletions qt/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Contributing

BeeWare <3's contributions!

Please be aware that BeeWare operates under a [Code of
Conduct](https://beeware.org/community/behavior/code-of-conduct/).

If you'd like to contribute to Toga development, our [contribution
guide](https://toga.readthedocs.io/en/latest/how-to/contribute/index.html) details how
to set up a development environment, and other requirements we have as part of our
contribution process.
27 changes: 27 additions & 0 deletions qt/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2025 Russell Keith-Magee.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. 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.

3. Neither the name of Toga 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.
57 changes: 57 additions & 0 deletions qt/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.. |pyversions| image:: https://img.shields.io/pypi/pyversions/toga-qt.svg
:target: https://pypi.python.org/pypi/toga-qt
:alt: Python Versions

.. |license| image:: https://img.shields.io/pypi/l/toga-qt.svg
:target: https://github.com/beeware/toga-qt/blob/main/LICENSE
:alt: BSD-3-Clause License

.. |maturity| image:: https://img.shields.io/pypi/status/toga-qt.svg
:target: https://pypi.python.org/pypi/toga-qt
:alt: Project status

toga-qt
========

|pyversions| |license| |maturity|

A Qt backend for the `Toga widget toolkit`_.

This package isn't much use by itself; it needs to be combined with `the core Toga library`_.

For platform requirements, see the Qt platform documentation (TODO).

For more details, see the `Toga project on GitHub`_.

.. _Toga widget toolkit: https://beeware.org/toga
.. _the core Toga library: https://pypi.python.org/pypi/toga-core
.. _Toga project on GitHub: https://github.com/beeware/toga

Community
---------

Toga is part of the `BeeWare suite`_. You can talk to the community through:

* `@[email protected] on Mastodon`_
* `Discord`_
* The Toga `GitHub Discussions forum`_

We foster a welcoming and respectful community as described in our
`BeeWare Community Code of Conduct`_.

.. _BeeWare suite: https://beeware.org
.. _@[email protected] on Mastodon: https://fosstodon.org/@beeware
.. _Discord: https://beeware.org/bee/chat/
.. _GitHub Discussions forum: https://github.com/beeware/toga/discussions
.. _BeeWare Community Code of Conduct: https://beeware.org/community/behavior/

Contributing
------------

If you experience problems with Toga, `log them on GitHub
<https://github.com/beeware/toga/issues>`__.

If you'd like to contribute to Toga development, our `contribution guide
<https://toga.readthedocs.io/en/latest/how-to/contribute/index.html>`__
details how to set up a development environment, and other requirements we have
as part of our contribution process.
77 changes: 77 additions & 0 deletions qt/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[build-system]
requires = [
"setuptools==80.9.0",
"setuptools_scm==9.2.0",
"setuptools_dynamic_dependencies==1.0.0",
]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["version", "dependencies"]
name = "toga-qt"
description = "An Qt (KDE) backend for the Toga widget toolkit."
readme = "README.rst"
requires-python = ">= 3.10"
license = "BSD-3-Clause"
license-files = [
"LICENSE"
]
authors = [
{name="John", email="[email protected]"},
{name="Russell Keith-Magee", email="[email protected]"},
]
maintainers = [
{name="BeeWare Team", email="[email protected]"},
]
keywords = [
"gui",
"widget",
"cross-platform",
"toga",
"desktop",
"qt",
]
classifiers = [
"Development Status :: 1 - Planning",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development",
"Topic :: Software Development :: User Interfaces",
"Topic :: Software Development :: Widget Sets",
]


[project.entry-points."toga.backends"]
linux = "toga_qt"

[tool.setuptools_scm]
root = ".."

[tool.setuptools_dynamic_dependencies]
dependencies = [
"qasync",
"toga-core == {version}",
"system-pyside6 @ git+https://github.com/johnzhou721/system-pyside6.git",
]

[tool.coverage.run]
parallel = true
branch = true
relative_files = true

# See notes in the root pyproject.toml file.
source = ["src"]
source_pkgs = ["toga_qt"]

[tool.coverage.paths]
source = [
"src/toga_qt",
"**/toga_qt",
]
9 changes: 9 additions & 0 deletions qt/src/toga_qt/__init__.py
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version number needs to be dynamically determined from Travertino

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Examples of valid version strings
# __version__ = '1.2.3.dev1' # Development release 1
# __version__ = '1.2.3a1' # Alpha Release 1
# __version__ = '1.2.3b1' # Beta Release 1
# __version__ = '1.2.3rc1' # RC Release 1
# __version__ = '1.2.3' # Final Release
# __version__ = '1.2.3.post1' # Post Release 1

__version__ = "0.0.0"
Loading