PySide2 configuration in yaml format providing the most simple script.
Project description
PyamlSide2(ぴゃむるさいどつー)
PySide2 configuration in yaml format providing the most simple script.
Requirements
- yaml
- PySide2
Installation
cd <path-to-ReadableWidgets>/PyamlSide2
pip install .
Demo
python3 examples/chaos.py
Template
See examples/simple_gui.py
.
import sys
import os
from pyamlside2.mainwindow import PyamlSide2Window
from PySide2.QtWidgets import QApplication
class MainWindow(pyamlside2Window):
def __init__(self):
self.number = 0
yaml_path = os.path.join(os.path.dirname(__file__), "../yaml/chaos.yaml")
super().__init__(yaml_path)
# your code -------------------------
# ************ #
# -----------------------------------
self.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
window = MainWindow()
sys.exit(app.exec_())
Test YAML 📝
pyamlside2_yaml
is preview feature app.
pyamlside2_yaml <yaml-file-path or draw.io xml-file>
# pyamlside2_yaml PySide2/drawio_xml/example.xml
Elements (dev)
In yaml, you can add the following elements defined in PyQt.Widgets This may be added in the future.
- pushbutton : definition of QPushButton
- qlabel : definition of QLabel
- qlcdnumber : definition of QLCDNumber
- qprogressbar : definition of QProgressBar
- qlineedit : definition of QLineEdit
- qcheckbox : definition of QCheckbox
- qslider : definition of QSlider
- qspinbox : definition of QSpinBox
- qcombobox : definition of QCombobox
- image : definition of QLabel (using image path)
- stylesheet : definition of Stylesheet (define as QLabel and
setHidden=True
)
YAML format
PyamlQt defines common elements for simplicity. Not all values need to be defined, but if not set, default values will be applied
WINDOW: # unique key (Define key)
type: window
x: 0
y: 0
width: 800
height: 720
title: "example"
slider2: # keyname
type: qslider # QWidgets
x_center: 500 # x center point
y_center: 550 # y center point
rect:
width: 200 # QWidgets width
height: 50 # QWidgets height
max: 100 # QObject max value
min: 0 # QObject min value
default: 70 # QObject set default value
text: "Slider" # Set Text
style: # Setting style using stylesheet (css)
font: 30px # font size
color: #ff0000 # Color
font-family: Ubuntu # font-family
items: # Selectable items( Combobox's option )
- a
- b
- c
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyamlside2-0.3.2.tar.gz
(11.6 kB
view hashes)
Built Distribution
pyamlside2-0.3.2-py3-none-any.whl
(13.5 kB
view hashes)
Close
Hashes for pyamlside2-0.3.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39ddaf5352ef8bc93cd1b38d4b987720b2580354d3b22e8cf0e7b49b7a89594b |
|
MD5 | d88a31284c6adb623daef66fd1e29930 |
|
BLAKE2b-256 | 6bed0a6da7b198f3db99374da433acfa8e050dbaa58699229c69b5f9b29b220c |