Skip to content

Commit

Permalink
feat(svg): add SvgWidget class
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Jan 27, 2021
1 parent ac03c67 commit 38a08c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prettyqt/svg/__init__.py
Expand Up @@ -6,6 +6,7 @@
from .graphicssvgitem import GraphicsSvgItem
from .svggenerator import SvgGenerator
from .svgrenderer import SvgRenderer
from .svgwidget import SvgWidget


__all__ = ["GraphicsSvgItem", "SvgGenerator", "SvgRenderer"]
__all__ = ["GraphicsSvgItem", "SvgGenerator", "SvgRenderer", "SvgWidget"]
15 changes: 15 additions & 0 deletions prettyqt/svg/svgwidget.py
@@ -0,0 +1,15 @@
from __future__ import annotations

import os
from typing import Union

from prettyqt import widgets
from prettyqt.qt import QtSvg


QtSvg.QSvgWidget.__bases__ = (widgets.Widget,)


class SvgWidget(QtSvg.QSvgWidget):
def load_file(self, path: Union[str, os.PathLike]):
self.load(os.fspath(path))

0 comments on commit 38a08c3

Please sign in to comment.