| 1 |
import enum |
| 2 |
|
| 3 |
from qt.core import QIODevice |
| 4 |
|
| 5 |
class RCCResourceLibrary: |
| 6 |
"Wraps Qt's rcc tool to compile .qrc resource files into a binary or source resource format" |
| 7 |
|
| 8 |
class Format(enum.Enum): |
| 9 |
Binary = enum.auto() |
| 10 |
C_Code = enum.auto() |
| 11 |
Pass1 = enum.auto() |
| 12 |
Pass2 = enum.auto() |
| 13 |
Python_Code = enum.auto() |
| 14 |
|
| 15 |
class CompressionAlgorithm(enum.Enum): |
| 16 |
Zlib = enum.auto() |
| 17 |
Zstd = enum.auto() |
| 18 |
Best = 99 |
| 19 |
None_ = -1 |
| 20 |
|
| 21 |
def __init__(self, formatVersion: int = 3) -> None: |
| 22 |
"Create a new RCCResourceLibrary with the specified resource format version" |
| 23 |
pass |
| 24 |
|
| 25 |
def output(self, outDevice: QIODevice, tempDevice: QIODevice, errorDevice: QIODevice) -> bool: |
| 26 |
"Write the compiled resources to outDevice, using tempDevice as scratch space and reporting errors on errorDevice" |
| 27 |
pass |
| 28 |
|
| 29 |
def readFiles(self, listMode: bool, errorDevice: QIODevice) -> bool: |
| 30 |
"Read the input .qrc files previously set with setInputFiles(), reporting errors on errorDevice" |
| 31 |
pass |
| 32 |
|
| 33 |
def setInputFiles(self, files: list[str]) -> None: |
| 34 |
"Set the list of paths to .qrc files to be compiled" |
| 35 |
pass |
| 36 |
|
| 37 |
def setFormat(self, f: Format) -> None: |
| 38 |
"Set the output format" |
| 39 |
pass |
| 40 |
|
| 41 |
def format(self) -> Format: |
| 42 |
"Return the output format" |
| 43 |
pass |
| 44 |
|
| 45 |
def setCompressionAlgorithm(self, algo: CompressionAlgorithm) -> None: |
| 46 |
"Set the compression algorithm used for resource data" |
| 47 |
pass |
| 48 |
|
| 49 |
def compressionAlgorithm(self) -> CompressionAlgorithm: |
| 50 |
"Return the compression algorithm used for resource data" |
| 51 |
pass |
| 52 |
|
| 53 |
def dataFiles(self) -> list[str]: |
| 54 |
"Return the list of data files referenced by the input .qrc files" |
| 55 |
pass |
| 56 |
|
| 57 |
def setVerbose(self, b: bool) -> None: |
| 58 |
"Set whether verbose diagnostic output is produced" |
| 59 |
pass |
| 60 |
|
| 61 |
def verbose(self) -> bool: |
| 62 |
"Return whether verbose diagnostic output is produced" |
| 63 |
pass |
| 64 |
|
| 65 |
def setResourceRoot(self, root: str) -> None: |
| 66 |
"Set the root path resource file paths are made relative to" |
| 67 |
pass |
| 68 |
|
| 69 |
def resourceRoot(self) -> str: |
| 70 |
"Return the root path resource file paths are made relative to" |
| 71 |
pass |
| 72 |
|
| 73 |
def setInitName(self, name: str) -> None: |
| 74 |
"Set the name used for the generated initialization function, for C_Code output" |
| 75 |
pass |
| 76 |
|
| 77 |
def initName(self) -> str: |
| 78 |
"Return the name used for the generated initialization function" |
| 79 |
pass |
| 80 |
|
| 81 |
def setOutputName(self, name: str) -> None: |
| 82 |
"Set the name of the output file" |
| 83 |
pass |
| 84 |
|
| 85 |
def outputName(self) -> str: |
| 86 |
"Return the name of the output file" |
| 87 |
pass |
| 88 |
|
| 89 |
def setUseNameSpace(self, v: bool) -> None: |
| 90 |
"Set whether generated C++ code is wrapped in a namespace" |
| 91 |
pass |
| 92 |
|
| 93 |
def useNameSpace(self) -> bool: |
| 94 |
"Return whether generated C++ code is wrapped in a namespace" |
| 95 |
pass |
| 96 |
|
| 97 |
def failedResources(self) -> list[str]: |
| 98 |
"Return the list of resources that failed to be read" |
| 99 |
pass |
| 100 |
|
| 101 |
def formatVersion(self) -> int: |
| 102 |
"Return the resource format version" |
| 103 |
pass |
| 104 |
|
| 105 |
def setNoZstd(self, v: bool) -> None: |
| 106 |
"Set whether zstd compression is disabled" |
| 107 |
pass |
| 108 |
|
| 109 |
def noZstd(self) -> bool: |
| 110 |
"Return whether zstd compression is disabled" |
| 111 |
pass |