QtSvg.pyi 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # The PEP 484 type hints stub file for the QtSvg module.
  2. #
  3. # Generated by SIP 6.15.3
  4. #
  5. # Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. #
  7. # This file is part of PyQt6.
  8. #
  9. # This file may be used under the terms of the GNU General Public License
  10. # version 3.0 as published by the Free Software Foundation and appearing in
  11. # the file LICENSE included in the packaging of this file. Please review the
  12. # following information to ensure the GNU General Public License version 3.0
  13. # requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. #
  15. # If you do not wish to use this file under the terms of the GPL version 3.0
  16. # then you may purchase a commercial license. For more information contact
  17. # info@riverbankcomputing.com.
  18. #
  19. # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. # WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. import collections, re, typing, enum
  22. try:
  23. from warnings import deprecated
  24. except ImportError:
  25. pass
  26. import PyQt6.sip
  27. from PyQt6 import QtCore
  28. from PyQt6 import QtGui
  29. # Support for QDate, QDateTime and QTime.
  30. import datetime
  31. # Convenient type aliases.
  32. PYQT_SIGNAL = typing.Union[QtCore.pyqtSignal, QtCore.pyqtBoundSignal]
  33. PYQT_SLOT = typing.Union[collections.abc.Callable[..., Any], QtCore.pyqtBoundSignal]
  34. class QtSvg(PyQt6.sip.simplewrapper):
  35. class Option(enum.Enum):
  36. NoOption = ... # type: QtSvg.Option
  37. Tiny12FeaturesOnly = ... # type: QtSvg.Option
  38. AssumeTrustedSource = ... # type: QtSvg.Option
  39. DisableSMILAnimations = ... # type: QtSvg.Option
  40. DisableCSSAnimations = ... # type: QtSvg.Option
  41. DisableAnimations = ... # type: QtSvg.Option
  42. class QSvgGenerator(QtGui.QPaintDevice):
  43. class SvgVersion(enum.Enum):
  44. SvgTiny12 = ... # type: QSvgGenerator.SvgVersion
  45. Svg11 = ... # type: QSvgGenerator.SvgVersion
  46. @typing.overload
  47. def __init__(self) -> None: ...
  48. @typing.overload
  49. def __init__(self, version: 'QSvgGenerator.SvgVersion') -> None: ...
  50. def initPainter(self, a0: QtGui.QPainter|None) -> None: ...
  51. def svgVersion(self) -> 'QSvgGenerator.SvgVersion': ...
  52. def metric(self, metric: QtGui.QPaintDevice.PaintDeviceMetric) -> int: ...
  53. def paintEngine(self) -> QtGui.QPaintEngine|None: ...
  54. @typing.overload
  55. def setViewBox(self, viewBox: QtCore.QRect) -> None: ...
  56. @typing.overload
  57. def setViewBox(self, viewBox: QtCore.QRectF) -> None: ...
  58. def viewBoxF(self) -> QtCore.QRectF: ...
  59. def viewBox(self) -> QtCore.QRect: ...
  60. def setDescription(self, description: str|None) -> None: ...
  61. def description(self) -> str: ...
  62. def setTitle(self, title: str|None) -> None: ...
  63. def title(self) -> str: ...
  64. def setResolution(self, resolution: int) -> None: ...
  65. def resolution(self) -> int: ...
  66. def setOutputDevice(self, outputDevice: QtCore.QIODevice|None) -> None: ...
  67. def outputDevice(self) -> QtCore.QIODevice|None: ...
  68. def setFileName(self, fileName: str|None) -> None: ...
  69. def fileName(self) -> str: ...
  70. def setSize(self, size: QtCore.QSize) -> None: ...
  71. def size(self) -> QtCore.QSize: ...
  72. class QSvgRenderer(QtCore.QObject):
  73. @typing.overload
  74. def __init__(self, parent: QtCore.QObject|None = ...) -> None: ...
  75. @typing.overload
  76. def __init__(self, filename: str|None, parent: QtCore.QObject|None = ...) -> None: ...
  77. @typing.overload
  78. def __init__(self, contents: QtCore.QByteArray|bytes|bytearray|memoryview, parent: QtCore.QObject|None = ...) -> None: ...
  79. @typing.overload
  80. def __init__(self, contents: QtCore.QXmlStreamReader|None, parent: QtCore.QObject|None = ...) -> None: ...
  81. @staticmethod
  82. def setDefaultOptions(flags: QtSvg.Option) -> None: ...
  83. def setAnimationEnabled(self, enable: bool) -> None: ...
  84. def isAnimationEnabled(self) -> bool: ...
  85. def setOptions(self, flags: QtSvg.Option) -> None: ...
  86. def options(self) -> QtSvg.Option: ...
  87. def transformForElement(self, id: str|None) -> QtGui.QTransform: ...
  88. def setAspectRatioMode(self, mode: QtCore.Qt.AspectRatioMode) -> None: ...
  89. def aspectRatioMode(self) -> QtCore.Qt.AspectRatioMode: ...
  90. repaintNeeded: typing.ClassVar[QtCore.pyqtSignal]
  91. @typing.overload
  92. def render(self, p: QtGui.QPainter|None) -> None: ...
  93. @typing.overload
  94. def render(self, p: QtGui.QPainter|None, bounds: QtCore.QRectF) -> None: ...
  95. @typing.overload
  96. def render(self, painter: QtGui.QPainter|None, elementId: str|None, bounds: QtCore.QRectF = ...) -> None: ...
  97. @typing.overload
  98. def load(self, filename: str|None) -> bool: ...
  99. @typing.overload
  100. def load(self, contents: QtCore.QByteArray|bytes|bytearray|memoryview) -> bool: ...
  101. @typing.overload
  102. def load(self, contents: QtCore.QXmlStreamReader|None) -> bool: ...
  103. def animationDuration(self) -> int: ...
  104. def setCurrentFrame(self, a0: int) -> None: ...
  105. def currentFrame(self) -> int: ...
  106. def setFramesPerSecond(self, num: int) -> None: ...
  107. def framesPerSecond(self) -> int: ...
  108. def boundsOnElement(self, id: str|None) -> QtCore.QRectF: ...
  109. def animated(self) -> bool: ...
  110. @typing.overload
  111. def setViewBox(self, viewbox: QtCore.QRect) -> None: ...
  112. @typing.overload
  113. def setViewBox(self, viewbox: QtCore.QRectF) -> None: ...
  114. def viewBoxF(self) -> QtCore.QRectF: ...
  115. def viewBox(self) -> QtCore.QRect: ...
  116. def elementExists(self, id: str|None) -> bool: ...
  117. def defaultSize(self) -> QtCore.QSize: ...
  118. def isValid(self) -> bool: ...