Skip to content

alejandro2014/qt-main-window-menu-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Main window with menu - QT with PySide generator

This script generates all the boilerplate for a Main window class with menu, using QT and PyDev.

Requirements

This script works using two json configuration files:

  • vars.json
  • menus.json

There are two example files in this project. Change them as you want. The explanation of the fields is as follow:

vars.json

  • $.main_window_class: Name of the class that will be generated (string).
  • $.window: Values of the window (object).
  • $.window.title: Title shown in the main window (string).
  • $.window.width: Width of the window (integer).
  • $.window.height: Height of the window (integer).

menus.json

  • $: Array with all the main options.
  • $[*]: Object with the main option (the one visible in the menu bar).
  • $[*].text: Visible text of the main option (string).
  • $[*].options: Suboptions, nested in the main option (array).
  • $[].options[].type: Type of the option. If this value is "separator", adds a separator and ignores the rest of the fields. It it's "option", the generator adds an option and uses the rest of the values. No more values are contemplated apart from this two (string).
  • $[].options[].text: Text shown in the suboption (string).
  • $[].options[].action: Name of the method that will be executed as callback of the option. If this methos is "exit_app" then adds the code that closes the program.

Execution

In order to run the program, fill the json files properly and simply type:

python generate-menus-class.py

This should generate the main class that will be executable.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages