pyqtbuild Module Reference¶
The pyqtbuild module provides a number of API elements that can be
used by a project’s project.py file.
PyQtBindings¶
- class pyqtbuild.PyQtBindings(project, name, **kwargs)¶
A
sipbuild.Bindingssub-class that configures aQmakeBuilderbuilder and supports the use of test programs to determine if a set of bindings are buildable and how they should be configured.Test programs are either internal or external. An internal test is constructed from the
test-headersandtest-statementkeys and is compiled (but not executed) to determine if the bindings are buildable.An external test is a self contained C++ source file with the same name as the bindings with a
cfgtest_prefix and a.cppextension. The source file is compiled and executed and it’s output analysed to determine if the bindings are buildable.- Parameters
project (PyQtProject) – is the project.
name (str) – is the name of the bindings.
**kwargs – are keyword arguments that define the initial values of any corresponding
sipbuild.Optiondefined by the bindings. Asipbuild.Optionvalue set in this way cannot be overridden in thepyproject.tomlfile or by using a tool command line option.
- handle_test_output(test_output)¶
Called by the bindings to handle the output from an external test program and to determine if the bindings are buildable. The default implementation assumes that the output is a list of disabled features and that the bindings are implicitly buildable.
- Parameters
test_output (list[str]) – is the output from an external test program.
- Returns
Trueif the bindings are buildable.
PyQtProject¶
- class pyqtbuild.PyQtProject(**kwargs)¶
A
sipbuild.Projectsub-class that provides different defaults for some keys in the[tool.sip.project]section ofpyproject.toml:the default value of
bindings-factoryisPyQtBindingsthe default value of
builder-factoryisQmakeBuilderthe default value of
sip-files-dirissipthe default value of
sip-moduleis determined by the version of Qtthe default value of
abi-versionis determined by the value ofsip-module.
- Parameters
**kwargs – are keyword arguments that define the initial values of any corresponding
sipbuild.Optiondefined by the project. Asipbuild.Optionvalue set in this way cannot be overridden in thepyproject.tomlfile or by using a tool command line option.
QmakeBuilder¶
- class pyqtbuild.QmakeBuilder(project, **kwargs)¶
A
sipbuild.Buildersub-class that uses Qt’s qmake program to build and install a project.- Parameters
project (Project) – is the
sipbuild.Projectobject.**kwargs – are keyword arguments that define the initial values of any corresponding
sipbuild.Optiondefined by the project. Asipbuild.Optionvalue set in this way cannot be overridden in thepyproject.tomlfile or by using a tool command line option.
- static qmake_quote(path)¶
If a file or directory path contains spaces then it is escaped so it can be used in a
.profile.- Parameters
path (str) – the path.
- Returns
the path, quoted if necessary.
- qt_configuration¶
A dict containing the Qt configuration information returned by running
qmake -query.
QmakeTargetInstallable¶
- class pyqtbuild.QmakeTargetInstallable(target, target_subdir)¶
A
sipbuild.Installablesub-class used to describe theTARGETof a.profile.- Parameters
target (str) – is the file name of the target.
target_subdir (str) – is the relative path name of a sub-directory in which the installable’s files will be installed. If it is an absolute path name then it is used as the eventual full target directory.