Skip to content

QuickWidget

Qt Base Class: QQuickWidget

Signature: QQuickWidget(self, engine: PySide6.QtQml.QQmlEngine, parent: PySide6.QtWidgets.QWidget) -> None QQuickWidget(self, parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None QQuickWidget(self, source: Union[PySide6.QtCore.QUrl, str], parent: Optional[PySide6.QtWidgets.QWidget] = None) -> None

Base classes

Name Children Inherits
WidgetMixin
prettyqt.widgets.widget
QQuickWidget
PySide6.QtQuickWidgets
QQuickWidget(self, engine: PySide6.QtQml.QQmlEngine, parent: PySide6.QtWidgets.QWidget) -> None

⋔ Inheritance diagram

graph TD
  1473374466224["quickwidgets.QuickWidget"]
  1473293688240["widgets.WidgetMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473245548480["gui.PaintDeviceMixin"]
  1473374468176["QtQuickWidgets.QQuickWidget"]
  1473290849680["QtWidgets.QWidget"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473300082368["QtGui.QPaintDevice"]
  1473293688240 --> 1473374466224
  1473299815024 --> 1473293688240
  140713234304496 --> 1473299815024
  1473245548480 --> 1473293688240
  140713234304496 --> 1473245548480
  1473374468176 --> 1473374466224
  1473290849680 --> 1473374468176
  1473288842240 --> 1473290849680
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473300082368 --> 1473290849680
  1473291690208 --> 1473300082368

🛈 DocStrings

Bases: WidgetMixin, QQuickWidget

Class providing a widget for displaying a Qt Quick user interface.

Source code in prettyqt\quickwidgets\quickwidget.py
class QuickWidget(widgets.WidgetMixin, QtQuickWidgets.QQuickWidget):
    """Class providing a widget for displaying a Qt Quick user interface."""

    def set_source(self, source: datatypes.UrlType | datatypes.PathType):
        if isinstance(source, os.PathLike):
            source = os.fspath(source)
        if isinstance(source, str):
            source = core.Url.fromLocalFile(source)
        self.setSource(source)

    def get_source(self) -> pathlib.Path:
        return pathlib.Path(self.source().toLocalFile())

    def get_status(self) -> StatusStr:
        return STATUS.inverse[self.status()]

⌗ Property table

Qt Property Type Doc
objectName QString
modal bool
windowModality Qt::WindowModality
enabled bool
geometry QRect
frameGeometry QRect
normalGeometry QRect
x int
y int
pos QPoint
frameSize QSize
size QSize
width int
height int
rect QRect
childrenRect QRect
childrenRegion QRegion
sizePolicy QSizePolicy
minimumSize QSize
maximumSize QSize
minimumWidth int
minimumHeight int
maximumWidth int
maximumHeight int
sizeIncrement QSize
baseSize QSize
palette QPalette
font QFont
cursor QCursor
mouseTracking bool
tabletTracking bool
isActiveWindow bool
focusPolicy Qt::FocusPolicy
focus bool
contextMenuPolicy Qt::ContextMenuPolicy
updatesEnabled bool
visible bool
minimized bool
maximized bool
fullScreen bool
sizeHint QSize
minimumSizeHint QSize
acceptDrops bool
windowTitle QString
windowIcon QIcon
windowIconText QString
windowOpacity double
windowModified bool
toolTip QString
toolTipDuration int
statusTip QString
whatsThis QString
accessibleName QString
accessibleDescription QString
layoutDirection Qt::LayoutDirection
autoFillBackground bool
styleSheet QString
locale QLocale
windowFilePath QString
inputMethodHints QFlags
resizeMode QQuickWidget::ResizeMode
status QQuickWidget::Status
source QUrl