cutienator 0.0.1.dev0__tar.gz → 0.0.1.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. cutienator-0.0.1.dev2/PKG-INFO +71 -0
  2. cutienator-0.0.1.dev2/README.md +39 -0
  3. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/pyproject.toml +7 -3
  4. cutienator-0.0.1.dev2/src/cutienator/QtCore/__init__.py +25 -0
  5. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/QtCore}/_q_binding_storage.py +2 -2
  6. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/QtCore}/_q_event.py +6 -5
  7. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/QtCore}/_q_meta_object.py +2 -2
  8. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/QtCore}/_q_object.py +117 -23
  9. cutienator-0.0.1.dev2/src/cutienator/QtCore/_q_size.py +470 -0
  10. cutienator-0.0.1.dev2/src/cutienator/__init__.py +19 -0
  11. cutienator-0.0.1.dev2/src/cutienator/cute/__init__.py +41 -0
  12. cutienator-0.0.1.dev2/src/cutienator/cute/_cute.py +172 -0
  13. cutienator-0.0.1.dev2/src/cutienator/cute/_cute_flags.py +420 -0
  14. cutienator-0.0.1.dev2/src/cutienator/cute/_cute_flags_hook.py +109 -0
  15. cutienator-0.0.1.dev2/src/cutienator/cute/_cute_flags_space.py +153 -0
  16. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_cute_load_hook.py +12 -50
  17. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_cute_mixin.py +90 -7
  18. cutienator-0.0.1.dev2/src/cutienator/cute/_cute_num.py +113 -0
  19. cutienator-0.0.1.dev2/src/cutienator/cute/_cute_num_space.py +64 -0
  20. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_cute_space.py +134 -1
  21. cutienator-0.0.1.dev2/src/cutienator/cute/_door_number.py +30 -0
  22. cutienator-0.0.1.dev2/src/cutienator/cute/_meta_cute_flags.py +31 -0
  23. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/occult/__init__.py +10 -8
  24. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/occult/_build.py +71 -24
  25. cutienator-0.0.1.dev0/src/cutienator/_q_widget.py → cutienator-0.0.1.dev2/src/cutienator/occult/_linux.py +69 -10
  26. cutienator-0.0.1.dev2/src/cutienator/occult/_mac_os.py +154 -0
  27. cutienator-0.0.1.dev2/src/cutienator/occult/_rituals.py +608 -0
  28. cutienator-0.0.1.dev2/src/cutienator/occult/_system.py +251 -0
  29. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/occult}/_ugly.py +195 -10
  30. cutienator-0.0.1.dev2/src/cutienator/occult/_windows.py +178 -0
  31. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_event.cpp +81 -0
  32. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_event.json +21 -0
  33. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_meta_object.cpp +465 -0
  34. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_meta_object.json +96 -0
  35. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_object.cpp +323 -0
  36. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_object.json +79 -0
  37. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_pointer.cpp +25 -0
  38. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_pointer.json +11 -0
  39. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_size.cpp +150 -0
  40. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_size.json +37 -0
  41. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_string.cpp +1038 -0
  42. cutienator-0.0.1.dev2/src/cutienator/occult/rituals/q_string.json +253 -0
  43. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/trial/_judge.py +38 -14
  44. cutienator-0.0.1.dev2/src/cutienator.egg-info/PKG-INFO +71 -0
  45. cutienator-0.0.1.dev2/src/cutienator.egg-info/SOURCES.txt +79 -0
  46. cutienator-0.0.1.dev2/tests/test_build.py +93 -0
  47. cutienator-0.0.1.dev2/tests/test_cute_flags.py +365 -0
  48. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_cute_load_hook.py +1 -1
  49. cutienator-0.0.1.dev2/tests/test_cute_mixin.py +87 -0
  50. cutienator-0.0.1.dev2/tests/test_cute_num.py +284 -0
  51. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_cute_overload.py +1 -1
  52. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_cute_space.py +2 -2
  53. cutienator-0.0.1.dev2/tests/test_door.py +268 -0
  54. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_meta_cute.py +1 -1
  55. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_q_object.py +74 -5
  56. cutienator-0.0.1.dev2/tests/test_q_size.py +201 -0
  57. cutienator-0.0.1.dev2/tests/test_rituals.py +206 -0
  58. cutienator-0.0.1.dev2/tests/test_system.py +171 -0
  59. cutienator-0.0.1.dev2/tests/test_ugly.py +211 -0
  60. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_wait.py +1 -1
  61. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_wait_bound_elsewhere.py +1 -1
  62. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_wait_settle_raises.py +1 -1
  63. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/tests/test_waiting_overload.py +1 -1
  64. cutienator-0.0.1.dev0/PKG-INFO +0 -33
  65. cutienator-0.0.1.dev0/README.md +0 -4
  66. cutienator-0.0.1.dev0/src/cutienator/__init__.py +0 -44
  67. cutienator-0.0.1.dev0/src/cutienator/_cpp_addr.py +0 -84
  68. cutienator-0.0.1.dev0/src/cutienator/_cpp_box.py +0 -23
  69. cutienator-0.0.1.dev0/src/cutienator/_header_descriptor.py +0 -4
  70. cutienator-0.0.1.dev0/src/cutienator/example/__init__.py +0 -21
  71. cutienator-0.0.1.dev0/src/cutienator/example/__main__.py +0 -67
  72. cutienator-0.0.1.dev0/src/cutienator/example/_calls.py +0 -107
  73. cutienator-0.0.1.dev0/src/cutienator/occult/_base_meta_ugly.py +0 -29
  74. cutienator-0.0.1.dev0/src/cutienator/occult/_cognito_warning.py +0 -35
  75. cutienator-0.0.1.dev0/src/cutienator/occult/_declaration.py +0 -572
  76. cutienator-0.0.1.dev0/src/cutienator/occult/_header.py +0 -710
  77. cutienator-0.0.1.dev0/src/cutienator/occult/_ritual.py +0 -19
  78. cutienator-0.0.1.dev0/src/cutienator/occult/_rituals.py +0 -594
  79. cutienator-0.0.1.dev0/src/cutienator/occult/rituals/q_event.cpp +0 -70
  80. cutienator-0.0.1.dev0/src/cutienator/occult/rituals/q_meta_object.cpp +0 -173
  81. cutienator-0.0.1.dev0/src/cutienator/occult/rituals/q_object.cpp +0 -178
  82. cutienator-0.0.1.dev0/src/cutienator.egg-info/PKG-INFO +0 -33
  83. cutienator-0.0.1.dev0/src/cutienator.egg-info/SOURCES.txt +0 -58
  84. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/LICENSE +0 -0
  85. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/setup.cfg +0 -0
  86. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/QtCore}/_q_thread.py +0 -0
  87. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_cute_overload.py +0 -0
  88. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_meta_cute.py +0 -0
  89. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_wait.py +0 -0
  90. {cutienator-0.0.1.dev0/src/cutienator → cutienator-0.0.1.dev2/src/cutienator/cute}/_waiting_overload.py +0 -0
  91. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/occult/__main__.py +0 -0
  92. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/occult/_shared_object.py +0 -0
  93. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/occult/_symbol.py +0 -0
  94. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/trial/__init__.py +0 -0
  95. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/trial/__main__.py +0 -0
  96. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/trial/_q_object_trials.py +0 -0
  97. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/trial/_trial.py +0 -0
  98. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator/trial/_verdict.py +0 -0
  99. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator.egg-info/dependency_links.txt +0 -0
  100. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator.egg-info/requires.txt +0 -0
  101. {cutienator-0.0.1.dev0 → cutienator-0.0.1.dev2}/src/cutienator.egg-info/top_level.txt +0 -0
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: cutienator
3
+ Version: 0.0.1.dev2
4
+ Summary: A vastly superior binding of Qt C++ to Python
5
+ Author-email: Asger Jon Vistisen <asgerjon2@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/AsgerJon/cutienator
8
+ Project-URL: Bug Tracker, https://github.com/AsgerJon/cutienator/issues
9
+ Classifier: Programming Language :: Python :: 3.7
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: 3.15
18
+ Classifier: Programming Language :: Python :: Implementation :: CPython
19
+ Classifier: Programming Language :: C++
20
+ Classifier: Operating System :: POSIX :: Linux
21
+ Classifier: Operating System :: MacOS
22
+ Classifier: Operating System :: Microsoft :: Windows
23
+ Classifier: Development Status :: 2 - Pre-Alpha
24
+ Classifier: Intended Audience :: Developers
25
+ Classifier: Natural Language :: English
26
+ Classifier: Topic :: Software Development :: Libraries
27
+ Requires-Python: >=3.7
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: worktoy>=1.2.2
31
+ Dynamic: license-file
32
+
33
+ [![Tokens](https://img.shields.io/badge/Tokens-0-D97757)](https://claude.com/claude-code)
34
+ [![PyPI version](https://img.shields.io/pypi/v/cutienator)](https://pypi.org/project/cutienator/)
35
+ [![Python versions](https://img.shields.io/pypi/pyversions/cutienator)](https://pypi.org/project/cutienator/)
36
+ [![Systems](https://img.shields.io/badge/Systems-Linux_%7C_macOS_%7C_Windows-informational)](#where-it-runs)
37
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
38
+
39
+ # cutienator v0.0.1-dev2 (development build)
40
+ A vastly superior binding of Qt C++ to Python.
41
+
42
+ # Where It Runs
43
+
44
+ On Linux, on macOS and on Windows. On Intel chips and on Apple silicon.
45
+ On every Python from 3.7* to 3.15.
46
+
47
+ Each release is tested on all of them before it goes out: 35 fresh
48
+ machines, each with its own system and its own Python, each building
49
+ cutienator against Qt 6.12 and calling Qt for real. A release happens
50
+ only if all 35 pass.
51
+
52
+ | System | Pythons | Machines |
53
+ |----------------------|-------------|---------:|
54
+ | Linux | 3.7 to 3.15 | 9 |
55
+ | macOS, Apple silicon | 3.8 to 3.15 | 8 |
56
+ | macOS, Intel chips | 3.7 to 3.15 | 9 |
57
+ | Windows | 3.7 to 3.15 | 9 |
58
+
59
+ *There is no Python 3.7 for Apple silicon. Maybe it is time to consider
60
+ updating if you are still using Python 3.7.
61
+
62
+ # What It Needs
63
+
64
+ **cutienator** compiles its own bridge to Qt on your machine, so it
65
+ needs what a build needs: Qt 6.12 with its program `qmake6`, and the
66
+ compiler `clang++`. On Windows that is the Qt built with Visual Studio,
67
+ and the `clang++` that comes with Visual Studio.
68
+
69
+ Both programs are found by name, so their folders have to be in `PATH`.
70
+ On Windows the `clang++` of Visual Studio lies in `VC\Tools\Llvm\x64\bin`
71
+ of the Visual Studio folder, and that folder has to come first.
@@ -0,0 +1,39 @@
1
+ [![Tokens](https://img.shields.io/badge/Tokens-0-D97757)](https://claude.com/claude-code)
2
+ [![PyPI version](https://img.shields.io/pypi/v/cutienator)](https://pypi.org/project/cutienator/)
3
+ [![Python versions](https://img.shields.io/pypi/pyversions/cutienator)](https://pypi.org/project/cutienator/)
4
+ [![Systems](https://img.shields.io/badge/Systems-Linux_%7C_macOS_%7C_Windows-informational)](#where-it-runs)
5
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
6
+
7
+ # cutienator v0.0.1-dev2 (development build)
8
+ A vastly superior binding of Qt C++ to Python.
9
+
10
+ # Where It Runs
11
+
12
+ On Linux, on macOS and on Windows. On Intel chips and on Apple silicon.
13
+ On every Python from 3.7* to 3.15.
14
+
15
+ Each release is tested on all of them before it goes out: 35 fresh
16
+ machines, each with its own system and its own Python, each building
17
+ cutienator against Qt 6.12 and calling Qt for real. A release happens
18
+ only if all 35 pass.
19
+
20
+ | System | Pythons | Machines |
21
+ |----------------------|-------------|---------:|
22
+ | Linux | 3.7 to 3.15 | 9 |
23
+ | macOS, Apple silicon | 3.8 to 3.15 | 8 |
24
+ | macOS, Intel chips | 3.7 to 3.15 | 9 |
25
+ | Windows | 3.7 to 3.15 | 9 |
26
+
27
+ *There is no Python 3.7 for Apple silicon. Maybe it is time to consider
28
+ updating if you are still using Python 3.7.
29
+
30
+ # What It Needs
31
+
32
+ **cutienator** compiles its own bridge to Qt on your machine, so it
33
+ needs what a build needs: Qt 6.12 with its program `qmake6`, and the
34
+ compiler `clang++`. On Windows that is the Qt built with Visual Studio,
35
+ and the `clang++` that comes with Visual Studio.
36
+
37
+ Both programs are found by name, so their folders have to be in `PATH`.
38
+ On Windows the `clang++` of Visual Studio lies in `VC\Tools\Llvm\x64\bin`
39
+ of the Visual Studio folder, and that folder has to come first.
@@ -5,7 +5,7 @@ build-backend = 'setuptools.build_meta'
5
5
 
6
6
  [project]
7
7
  name = "cutienator"
8
- version = "0.0.1-dev0"
8
+ version = "0.0.1-dev2"
9
9
  authors = [
10
10
  { name = "Asger Jon Vistisen", email = "asgerjon2@gmail.com" },
11
11
  ]
@@ -28,7 +28,10 @@ classifiers = [
28
28
  'Programming Language :: Python :: 3.14',
29
29
  'Programming Language :: Python :: 3.15',
30
30
  "Programming Language :: Python :: Implementation :: CPython",
31
+ "Programming Language :: C++",
31
32
  "Operating System :: POSIX :: Linux",
33
+ "Operating System :: MacOS",
34
+ "Operating System :: Microsoft :: Windows",
32
35
  "Development Status :: 2 - Pre-Alpha",
33
36
  "Intended Audience :: Developers",
34
37
  "Natural Language :: English",
@@ -46,9 +49,10 @@ test = [
46
49
  ]
47
50
 
48
51
  # The ritual files are C++ that 'cutienator.occult.Rituals' compiles on the
49
- # machine the package is installed on, so they ship with the package.
52
+ # machine the package is installed on, so they ship with the package,
53
+ # each with its rows file, which says what its rituals take and give.
50
54
  [tool.setuptools.package-data]
51
- cutienator = ["occult/rituals/*.cpp"]
55
+ cutienator = ["occult/rituals/*.cpp", "occult/rituals/*.json"]
52
56
 
53
57
  # pytest configuration lives here rather than in a root 'pytest.ini' so
54
58
  # the repository root stays uncluttered. pytest auto-discovers this
@@ -0,0 +1,25 @@
1
+ """
2
+ The 'cutienator.QtCore' package provides the cute classes of the part of
3
+ Qt named QtCore, under the name PySide6 has for it.
4
+
5
+ from cutienator.QtCore import QObject, QSize
6
+ """
7
+ # Apache-2.0 license
8
+ # Copyright (c) 2026 Asger Jon Vistisen
9
+ from __future__ import annotations
10
+
11
+ from ._q_meta_object import QMetaObject
12
+ from ._q_binding_storage import QBindingStorage
13
+ from ._q_event import QEvent
14
+ from ._q_size import QSize
15
+ from ._q_object import QObject
16
+ from ._q_thread import QThread
17
+
18
+ __all__ = (
19
+ 'QMetaObject',
20
+ 'QBindingStorage',
21
+ 'QEvent',
22
+ 'QSize',
23
+ 'QObject',
24
+ 'QThread',
25
+ )
@@ -5,8 +5,8 @@ QBindingStorage binding of the Qt C++, so far in name only.
5
5
  # Copyright (c) 2026 Asger Jon Vistisen
6
6
  from __future__ import annotations
7
7
 
8
- from ._cute_mixin import CuteMixin
9
- from ._meta_cute import MetaCute
8
+ from cutienator.cute._cute_mixin import CuteMixin
9
+ from cutienator.cute._meta_cute import MetaCute
10
10
 
11
11
 
12
12
  class QBindingStorage(CuteMixin, metaclass=MetaCute):
@@ -9,10 +9,10 @@ from typing import TYPE_CHECKING
9
9
 
10
10
  from worktoy.dispatch import overload
11
11
 
12
- from ._cute_mixin import CuteMixin
13
- from ._meta_cute import MetaCute
14
- from ._ugly import Ugly
15
- from .occult import Rituals
12
+ from cutienator.cute._cute_mixin import CuteMixin
13
+ from cutienator.cute._meta_cute import MetaCute
14
+ from cutienator.occult._ugly import Ugly
15
+ from ..occult import Rituals
16
16
 
17
17
  if TYPE_CHECKING: # pragma: no cover, no mutate
18
18
  from typing import Optional
@@ -41,7 +41,8 @@ class QEvent(CuteMixin, metaclass=MetaCute):
41
41
  --------------
42
42
 
43
43
  - The C++ QEvent is created at the first use, not by 'QEvent(0)'.
44
- - Nothing deletes the C++ QEvent yet.
44
+ - Python never removes the C++ QEvent. C++ cannot copy one, so it is
45
+ no value, and Qt may keep one it is handed.
45
46
  """
46
47
 
47
48
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -5,8 +5,8 @@ QMetaObject binding of the Qt C++, so far with one function.
5
5
  # Copyright (c) 2026 Asger Jon Vistisen
6
6
  from __future__ import annotations
7
7
 
8
- from ._cute_mixin import CuteMixin
9
- from ._meta_cute import MetaCute
8
+ from cutienator.cute._cute_mixin import CuteMixin
9
+ from cutienator.cute._meta_cute import MetaCute
10
10
 
11
11
 
12
12
  class QMetaObject(CuteMixin, metaclass=MetaCute):
@@ -10,14 +10,14 @@ from typing import TYPE_CHECKING
10
10
  from worktoy.core.sentinels import THIS
11
11
  from worktoy.dispatch import overload
12
12
 
13
- from ._cute_mixin import CuteMixin
14
- from ._meta_cute import MetaCute
13
+ from cutienator.cute._cute_mixin import CuteMixin
14
+ from cutienator.cute._meta_cute import MetaCute
15
15
  from ._q_binding_storage import QBindingStorage
16
16
  from ._q_event import QEvent
17
17
  from ._q_meta_object import QMetaObject
18
- from ._ugly import Ugly
19
- from ._wait import WAIT
20
- from .occult import Rituals
18
+ from cutienator.occult._ugly import Ugly
19
+ from cutienator.cute._wait import WAIT
20
+ from ..occult import Rituals
21
21
 
22
22
  if TYPE_CHECKING: # pragma: no cover, no mutate
23
23
  from typing import Optional
@@ -35,6 +35,8 @@ class QObject(CuteMixin, metaclass=MetaCute):
35
35
  mother = QObject()
36
36
  child = QObject(mother)
37
37
  child.parent() is mother # True
38
+ child.setObjectName('cutie')
39
+ child.objectName() # 'cutie'
38
40
  child.metaObject().className() # 'QObject'
39
41
  child.thread() # the QThread Python runs in
40
42
 
@@ -46,35 +48,48 @@ class QObject(CuteMixin, metaclass=MetaCute):
46
48
  What exists
47
49
  -----------
48
50
 
49
- Every function of Qt's QObject that has a ritual, 22 names in all:
50
- 'parent', 'setParent', 'thread', 'metaObject', 'bindingStorage',
51
- 'inherits', 'isWidgetType', 'isWindowType', 'isQuickItemType',
52
- 'isQmlExposed', 'signalsBlocked', 'blockSignals', 'event',
53
- 'eventFilter', 'installEventFilter', 'removeEventFilter', 'startTimer',
54
- 'killTimer', 'disconnect', 'dumpObjectTree', 'dumpObjectInfo' and
55
- 'deleteLater'. Creation takes a parent, None, or nothing.
51
+ Every function of Qt's QObject that has a ritual and takes and gives
52
+ nothing but numbers, text and objects of a cute class, 25 names in
53
+ all: 'parent', 'setParent', 'objectName', 'setObjectName', 'tr',
54
+ 'thread', 'metaObject', 'bindingStorage', 'inherits', 'isWidgetType',
55
+ 'isWindowType', 'isQuickItemType', 'isQmlExposed', 'signalsBlocked',
56
+ 'blockSignals', 'event', 'eventFilter', 'installEventFilter',
57
+ 'removeEventFilter', 'startTimer', 'killTimer', 'disconnect',
58
+ 'dumpObjectTree', 'dumpObjectInfo' and 'deleteLater'. Creation takes
59
+ a parent, None, or nothing.
56
60
 
57
61
  What has a ritual and is left out, and why
58
62
  ------------------------------------------
59
63
 
60
- - Qt's '~QObject()'. Python has no name for deleting an object, and a
61
- cute object whose C++ object is gone has no meaning yet.
64
+ - Qt's '~QObject()'. Python never removes a C++ QObject: Qt may
65
+ still use it.
62
66
  - Qt's 'killTimer(Qt::TimerId id)'. No enum is reflected yet, so it
63
67
  would take an 'int', as 'killTimer(int id)' does, and one name
64
68
  cannot have two functions for one signature.
65
69
  - Qt's 'bindingStorage() const'. It differs from 'bindingStorage()'
66
70
  only in what C++ may do with the answer, which Python cannot say.
67
- - Qt's 'disconnect(sender, signal, receiver, member)'. It is a static
68
- function, and the other two of that name are not. worktoy lets one
71
+ - Qt's 'disconnect(sender, signal, receiver, member)' and
72
+ 'disconnect(const QMetaObject::Connection &)'. They are static
73
+ functions, and the other two of that name are not. worktoy lets one
69
74
  name be one kind of method.
75
+ - Qt's three 'connect' taking text or QMetaMethod. They give a
76
+ 'QMetaObject::Connection', which has no cute class yet. They come
77
+ with the signals.
78
+ - Qt's 'disconnect' taking two QMetaMethod, which has no cute class
79
+ yet.
80
+ - Qt's 'property' and 'setProperty'. They give and take a QVariant,
81
+ which has no cute class yet.
82
+ - Qt's 'moveToThread'. Its declaration takes a second argument, a
83
+ mark of Qt's own named 'Qt::Disambiguated_t', which has no cute
84
+ class.
70
85
 
71
86
  What has no ritual yet
72
87
  ----------------------
73
88
 
74
- 52 of the 80 functions Qt declares, among them 'objectName',
75
- 'setObjectName', 'connect', 'children', 'property', 'setProperty',
76
- 'findChild' and 'moveToThread'. Most take or give a type that no
77
- ritual can pass yet, as Qt's QString.
89
+ 41 of the 80 functions Qt declares, among them 'children',
90
+ 'findChild', 'findChildren' and 'dynamicPropertyNames'. Some take or
91
+ give a type that no ritual can pass yet, as a list. Others are
92
+ patterns for functions, are for a subclass alone, or are signals.
78
93
 
79
94
  What to expect
80
95
  --------------
@@ -84,20 +99,60 @@ class QObject(CuteMixin, metaclass=MetaCute):
84
99
  stands for it when there is one, as 'parent' after 'setParent'. For
85
100
  an object C++ made itself, as the thread, it gives a new cute object
86
101
  made around it.
102
+ - Qt's QString is a plain 'str', taken and given: 'setObjectName'
103
+ takes one and 'objectName' gives one. There is no QString class.
87
104
  - Where Qt takes an object or text and reads nothing as 'none given',
88
105
  None is taken. Where Qt fills in an argument left out, that is not
89
106
  done yet: every argument is given.
90
107
  - An enum of Qt is taken and given as its number.
91
108
  - A wrong argument is refused in Python, with 'DispatchException',
92
109
  and never reaches C++.
93
- - Nothing deletes the C++ QObject yet, and nothing notices when C++
94
- deletes it, which a parent does to its children when it goes.
110
+ - Python never removes the C++ QObject. Qt does: a parent removes its
111
+ children when it goes, and 'deleteLater' asks for it.
112
+ - Qt tells when it has removed a C++ QObject. Every call on the cute
113
+ object, and every use of it as an argument, then raises
114
+ 'RuntimeError', and nothing reaches C++.
95
115
  """
96
116
 
97
117
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
98
118
  # STATIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
99
119
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
100
120
 
121
+ @staticmethod
122
+ @overload(str, str, int)
123
+ @overload(str, NoneType, int)
124
+ def tr(s: str, c: Optional[str], n: int) -> str:
125
+ """
126
+ Calls Qt's 'QString QObject::tr(const char *s, const char *c, int
127
+ n)'.
128
+
129
+ Qt's own words: https://doc.qt.io/qt-6/qobject.html#tr
130
+
131
+ Parameters
132
+ ----------
133
+
134
+ s : str
135
+ Passed on as the bytes of the text.
136
+
137
+ c : Optional[str]
138
+ Passed on as the bytes of the text. None is passed on as no text.
139
+
140
+ n : int
141
+ Passed on as it is. Qt fills this in with -1 when it is left out;
142
+ here it has to be given.
143
+
144
+ Returns
145
+ -------
146
+
147
+ str
148
+ The text Qt gave back: 's' itself when no translation is loaded.
149
+ """
150
+ # QString QObject::tr(const char *s, const char *c, int n)
151
+ return Rituals.call(
152
+ 'ritual_ZN7QObject2trEPKcS1_i',
153
+ CuteMixin._bytesOf(s), CuteMixin._bytesOf(c), n,
154
+ )
155
+
101
156
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
102
157
  # NAMESPACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
103
158
  # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -107,6 +162,10 @@ class QObject(CuteMixin, metaclass=MetaCute):
107
162
  # this one. 'thread' gives one back all the same; see 'WAIT'.
108
163
  QThread = WAIT['QThread']
109
164
 
165
+ # Qt can watch a QObject and tell when it has removed it. Every class
166
+ # built on this one is a QObject too, and inherits this.
167
+ __watched_by_qt__ = True
168
+
110
169
  # Fallback Variables
111
170
 
112
171
  # Private Variables
@@ -128,12 +187,14 @@ class QObject(CuteMixin, metaclass=MetaCute):
128
187
 
129
188
  'CuteMixin' calls this at the first read of 'uglySide'. The C++
130
189
  QObject is created with the parent given to 'QObject(...)', which is
131
- created first when it is not yet.
190
+ created first when it is not yet. Qt watches the new C++ QObject
191
+ from here on, so a call made after Qt has removed it is refused.
132
192
  """
133
193
  # QObject::QObject(QObject *parent)
134
194
  parent = self._addressOf(self.__given_parent__)
135
195
  ugly = Ugly()
136
196
  ugly.setAddress(Rituals.call('ritual_ZN7QObjectC1EPS_', parent))
197
+ ugly.watch()
137
198
  ugly.setCuteSide(self)
138
199
  self.__ugly_side__ = ugly
139
200
  self.__given_parent__ = None
@@ -258,6 +319,21 @@ class QObject(CuteMixin, metaclass=MetaCute):
258
319
  address = self.uglySide.call('ritual_ZNK7QObject6parentEv')
259
320
  return QObject._cuteAt(address)
260
321
 
322
+ def objectName(self) -> str:
323
+ """
324
+ Calls Qt's 'QString QObject::objectName() const'.
325
+
326
+ Qt's own words: https://doc.qt.io/qt-6/qobject.html#objectName-prop
327
+
328
+ Returns
329
+ -------
330
+
331
+ str
332
+ The text Qt gave back.
333
+ """
334
+ # QString QObject::objectName() const
335
+ return self.uglySide.call('ritual_ZNK7QObject10objectNameEv')
336
+
261
337
  @overload(str)
262
338
  def inherits(self, classname: str) -> bool:
263
339
  """
@@ -296,6 +372,24 @@ class QObject(CuteMixin, metaclass=MetaCute):
296
372
  # bool QObject::blockSignals(bool b)
297
373
  return self.uglySide.call('ritual_ZN7QObject12blockSignalsEb', b)
298
374
 
375
+ @overload(str)
376
+ def setObjectName(self, name: str) -> None:
377
+ """
378
+ Calls Qt's 'void QObject::setObjectName(QAnyStringView name)'.
379
+
380
+ Qt's own words: https://doc.qt.io/qt-6/qobject.html#objectName-prop
381
+
382
+ Parameters
383
+ ----------
384
+
385
+ name : str
386
+ Passed on as it is: a QString is made of it for the call.
387
+ """
388
+ # void QObject::setObjectName(QAnyStringView name)
389
+ self.uglySide.call(
390
+ 'ritual_ZN7QObject13setObjectNameE14QAnyStringView', name,
391
+ )
392
+
299
393
  @overload(THIS)
300
394
  @overload(NoneType)
301
395
  def setParent(self, parent: Optional[QObject]) -> None: