Skip to main content

PyQt6 configuration in yaml format providing the most simple script.

Project description

PyamlQt(ぴゃむるきゅーと)

PyPI version

PyQt6 configuration in yaml format providing the most simple script.

Requirements

  • yaml
  • PyQt6, ( PyQt5 )

Installation

pip install PyamlQt

Demo

python3 examples/chaos.py

Template

See examples/simple_gui.py.

import sys
import os

from pyamlqt.mainwindow import PyamlQtWindow
from PyQt6.QtWidgets import QApplication

class MainWindow(PyamlQtWindow):
    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 📝

pyamlqt_yaml is preview feature app.

pyamlqt_yaml <yaml-file-path>
# pyamlqt_yaml PyamlQt/yaml/chaos.yaml

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

PyQt5 Mode

If you want to use PyQt5, you have to change the qt6_switch.py file.

  • Open the file and change the qt6_mode variable to False.
  • pip install PyQt5
  • pip install .

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

PyamlQt-0.3.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

PyamlQt-0.3.1-py3-none-any.whl (20.1 kB view details)

Uploaded Python 3

File details

Details for the file PyamlQt-0.3.1.tar.gz.

File metadata

  • Download URL: PyamlQt-0.3.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for PyamlQt-0.3.1.tar.gz
Algorithm Hash digest
SHA256 6072a6ad3ed38b0f498022ac15c8ce0bcf53cc6c8cfb14628f42a1340a6076dd
MD5 dc8b009f7db1fddc7bf6c781af9ef7aa
BLAKE2b-256 e0993089c37097243dd83a0032b63677560aa6de86963fe9dad213566bd49cab

See more details on using hashes here.

File details

Details for the file PyamlQt-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: PyamlQt-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 20.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.8.10

File hashes

Hashes for PyamlQt-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 204c7d3810e55f001e37c0cd57e12d9e06cd83a4bfe50c46b94158f611ea70c0
MD5 7fc6db0fbfa581296f7d68549210fcb3
BLAKE2b-256 e71ee17233046618c90c318acaa885aab916e250266843098fb7fc5a6d739861

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page