Skip to main content

PySimpleGUI designer, that uses transpiler to produce code from Qt Designer xml file.

Project description

PySimpleGUI Designer

Install:

# Requirements: pyside2
# $ pip install PySide2
pip install PySimpleGUIDesigner

Usage

Use GUI(by default):

PySimpleGUIDesigner

Use CLI:

PySimpleGUIDesigner -xml "~/folder1/test.ui" -ob "somegroupBox"

Want to know parameters? Get help by:

PySimpleGUIDesigner --help

Output:

Usage: main.py [OPTIONS]

Options:
  -v, --verbose                   Verbose mode
  -x, --run                       Just run gui example
  -xml, --xmlfile PATH            absolute or relative path to ui_file
  -ob, --objname TEXT             Object name of target container
  -nobadwidgets                   Forget about not-implemented(bad) widgets.
                                  Default - True
  -ic, --indent_char TEXT         Indent character. Default is " "
  -ia, --indent_char_size INTEGER
                                  Indent size
  -o, --outputfile PATH           Output file for PySimpleGUI code
  -pp_mouse                       Option - generate buttons events
  -pp_keys                        Option - generate all events
  --help                          Show this message and exit.

I don't want pip install, how to use this repo's source code?

Download this repo, cd into it.

Run gui:

python3 main.py

If you see this error:

ModuleNotFoundError: No module named '__main__.transpiler2'; '__main__' is not a package

THEN just change in main.py line:

from .transpiler2 import *

to

from transpiler2 import *


Using as normal (easy):

python3 main.py --xmlfile="~/folder1/test.ui" --objname="somegroupBox"
# OR
python3 main.py -xml "~/folder1/test.ui" -ob "somegroupBox"

Examples:

#=================== Basics:
### relative path
python3 main.py -xmlfile "untitled.ui" -objname="text1"
python3 main.py -xmlfile "examples_of_ui/untitled.ui" -objname="vv1"
### absolute path
python3 main.py -xmlfile "/tmp/examples_of_ui/untitled.ui" -objname="text1"

#=================== Indent:
# ia = indent amount, ic = indent char
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " "
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " " -ia 1 # the same effect, as command above

python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " " -ia 2


### add boilerplate to output file
python3 main.py -xmlfile "untitled.ui" -objname="text1" -pp_mouse -ic " " -ia 2
python3 main.py -xmlfile "untitled.ui" -objname="text1" -pp_keys
python3 main.py -xmlfile "untitled.ui" -objname="text1" -ic " " -ia 2 -pp_keys

Todo

Possible:

  • improve psg_ui_maker.py - somewhere in __init__ method, maybe;
  • add some picking templates for user
  • add some boilerplate's in output generated code
  • maybe some unit tests, idk. pytest?

FAQ

How do I use PySimpleGUIDesigner WITH Qt Designer? Watch this video (by me):

https://www.youtube.com/watch?v=dN7gXwnNoBA

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

PySimpleGUIDesigner-0.1.4.2.tar.gz (16.9 kB view hashes)

Uploaded Source

Built Distribution

PySimpleGUIDesigner-0.1.4.2-py3-none-any.whl (18.9 kB view hashes)

Uploaded Python 3

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