Application

Main QtPyVCP Application Module

Contains the VCPApplication class with core function and VCP loading logic.

class qtpyvcp.application.VCPApplication(theme=None, stylesheet=None, custom_fonts=[])[source]
loadFont(font_path)[source]

Loads a font file into the font database. The path can specify the location of a font file or a qresource.

loadPyFile(pyfile, opts)[source]

Load a .py file, performs some sanity checks to try and determine if the file actually contains a valid VCPMainWindow subclass, and if the checks pass, create and return an instance.

This is an internal method, users will usually want to use loadVCP instead.

Parameters:
  • pyfile (str) – The path to a .py file to load.
  • opts (OptDict) – A OptDict of options to pass to the VCPMainWindow subclass.
Returns:

Return type:

VCPMainWindow instance

loadStylesheet(stylesheet)[source]

Loads a QSS stylesheet file containing styles to be applied to specific Qt and/or QtPyVCP widget classes.

Parameters:stylesheet (str) – Path to the .qss stylesheet to load.
loadVCPMainWindow(opts, vcp_file=None)[source]

Loads a VCPMainWindow instance defined by a Qt .ui file, a Python .py file, or from a VCP python package.

Parameters:
  • vcp_file (str) – The path or name of the VCP to load.
  • opts (OptDict) – A OptDict of options to pass to the VCPMainWindow subclass.
Returns:

Return type:

VCPMainWindow instance