qtarrow 0.1.0__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.
- qtarrow-0.1.0/PKG-INFO +19 -0
- qtarrow-0.1.0/QtArrow/__init__.py +7 -0
- qtarrow-0.1.0/QtArrow/button.py +24 -0
- qtarrow-0.1.0/QtArrow/checkbox.py +24 -0
- qtarrow-0.1.0/QtArrow/core.py +11 -0
- qtarrow-0.1.0/QtArrow/loadui.py +34 -0
- qtarrow-0.1.0/README.md +6 -0
- qtarrow-0.1.0/pyproject.toml +22 -0
- qtarrow-0.1.0/qtarrow.egg-info/PKG-INFO +19 -0
- qtarrow-0.1.0/qtarrow.egg-info/SOURCES.txt +12 -0
- qtarrow-0.1.0/qtarrow.egg-info/dependency_links.txt +1 -0
- qtarrow-0.1.0/qtarrow.egg-info/requires.txt +1 -0
- qtarrow-0.1.0/qtarrow.egg-info/top_level.txt +1 -0
- qtarrow-0.1.0/setup.cfg +4 -0
qtarrow-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qtarrow
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A comprehensive, fully-featured PySide6 wrapper library designed to simplify UI loading, widget management, and desktop application development.
|
|
5
|
+
Author: Albiemer R. Porte
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: PySide6
|
|
13
|
+
|
|
14
|
+
\# QtArrow
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
A comprehensive, fully-featured PySide6 wrapper library designed to simplify UI loading, widget management, and desktop application development.
|
|
19
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from PySide6.QtWidgets import QPushButton
|
|
2
|
+
|
|
3
|
+
def mybutton(widget: QPushButton, *actions):
|
|
4
|
+
"""
|
|
5
|
+
Button binder, flattened tuple-style, hidden executor.
|
|
6
|
+
- widget: actual QPushButton
|
|
7
|
+
- *actions: each argument is a tuple (func, *args)
|
|
8
|
+
"""
|
|
9
|
+
if not actions:
|
|
10
|
+
raise ValueError("At least one action must be provided")
|
|
11
|
+
|
|
12
|
+
# Pre-bind all actions into callables
|
|
13
|
+
callables = []
|
|
14
|
+
for act in actions:
|
|
15
|
+
func = act[0]
|
|
16
|
+
args = act[1:] if len(act) > 1 else []
|
|
17
|
+
callables.append(lambda f=func, a=args: f(*a))
|
|
18
|
+
|
|
19
|
+
def __executor():
|
|
20
|
+
for c in callables:
|
|
21
|
+
c()
|
|
22
|
+
|
|
23
|
+
widget.clicked.connect(__executor)
|
|
24
|
+
return widget
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
from PySide6.QtWidgets import QCheckBox
|
|
2
|
+
|
|
3
|
+
def mycheckbox(widget: QCheckBox, *actions):
|
|
4
|
+
"""
|
|
5
|
+
Checkbox binder, flattened tuple-style, hidden executor.
|
|
6
|
+
- widget: actual QCheckBox
|
|
7
|
+
- *actions: each argument is a tuple (func, *args)
|
|
8
|
+
"""
|
|
9
|
+
if not actions:
|
|
10
|
+
raise ValueError("At least one action must be provided")
|
|
11
|
+
|
|
12
|
+
# Pre-bind all actions into callables
|
|
13
|
+
callables = []
|
|
14
|
+
for act in actions:
|
|
15
|
+
func = act[0]
|
|
16
|
+
args = act[1:] if len(act) > 1 else []
|
|
17
|
+
callables.append(lambda f=func, a=args: f(*a))
|
|
18
|
+
|
|
19
|
+
def __executor(state):
|
|
20
|
+
for c in callables:
|
|
21
|
+
c()
|
|
22
|
+
|
|
23
|
+
widget.stateChanged.connect(__executor)
|
|
24
|
+
return widget
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from PySide6.QtWidgets import QPushButton
|
|
2
|
+
|
|
3
|
+
class UIExecutor:
|
|
4
|
+
"""Handles execution of tuple/conditional expressions or callables"""
|
|
5
|
+
@staticmethod
|
|
6
|
+
def execute(action):
|
|
7
|
+
# Always make it iterable
|
|
8
|
+
items = action if isinstance(action, tuple) else (action,)
|
|
9
|
+
for item in items:
|
|
10
|
+
if callable(item):
|
|
11
|
+
item() # run only when clicked
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
from PySide6.QtUiTools import QUiLoader
|
|
3
|
+
from PySide6.QtCore import QFile, QObject
|
|
4
|
+
|
|
5
|
+
class ArrowUi:
|
|
6
|
+
def __init__(self, ui):
|
|
7
|
+
self.ui = ui
|
|
8
|
+
|
|
9
|
+
def load_ui(self):
|
|
10
|
+
"""
|
|
11
|
+
Load a .ui file dynamically in PySide6.
|
|
12
|
+
Automatically attaches all child widgets as attributes.
|
|
13
|
+
Returns the loaded widget (QMainWindow, QDialog, QWidget).
|
|
14
|
+
"""
|
|
15
|
+
# Open the .ui file
|
|
16
|
+
ui_file = QFile(self.ui)
|
|
17
|
+
if not ui_file.open(QFile.ReadOnly):
|
|
18
|
+
raise FileNotFoundError(f"Cannot open {self.ui}")
|
|
19
|
+
|
|
20
|
+
# Load the UI
|
|
21
|
+
loader = QUiLoader()
|
|
22
|
+
widget = loader.load(ui_file)
|
|
23
|
+
ui_file.close()
|
|
24
|
+
|
|
25
|
+
if widget is None:
|
|
26
|
+
raise RuntimeError(f"Failed to load UI from {self.ui}")
|
|
27
|
+
|
|
28
|
+
# Attach all child widgets as attributes by objectName
|
|
29
|
+
for child in widget.findChildren(QObject):
|
|
30
|
+
name = child.objectName()
|
|
31
|
+
if name: # only if the widget has an objectName
|
|
32
|
+
setattr(widget, name, child)
|
|
33
|
+
|
|
34
|
+
return widget
|
qtarrow-0.1.0/README.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "qtarrow"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A comprehensive, fully-featured PySide6 wrapper library designed to simplify UI loading, widget management, and desktop application development."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{ name = "Albiemer R. Porte" }
|
|
12
|
+
]
|
|
13
|
+
license = { text = "MIT" }
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
]
|
|
19
|
+
requires-python = ">=3.8"
|
|
20
|
+
dependencies = [
|
|
21
|
+
"PySide6"
|
|
22
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: qtarrow
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A comprehensive, fully-featured PySide6 wrapper library designed to simplify UI loading, widget management, and desktop application development.
|
|
5
|
+
Author: Albiemer R. Porte
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.8
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Requires-Dist: PySide6
|
|
13
|
+
|
|
14
|
+
\# QtArrow
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
A comprehensive, fully-featured PySide6 wrapper library designed to simplify UI loading, widget management, and desktop application development.
|
|
19
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
QtArrow/__init__.py
|
|
4
|
+
QtArrow/button.py
|
|
5
|
+
QtArrow/checkbox.py
|
|
6
|
+
QtArrow/core.py
|
|
7
|
+
QtArrow/loadui.py
|
|
8
|
+
qtarrow.egg-info/PKG-INFO
|
|
9
|
+
qtarrow.egg-info/SOURCES.txt
|
|
10
|
+
qtarrow.egg-info/dependency_links.txt
|
|
11
|
+
qtarrow.egg-info/requires.txt
|
|
12
|
+
qtarrow.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PySide6
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
QtArrow
|
qtarrow-0.1.0/setup.cfg
ADDED