From 1eeffc2c07c93fe7c5bfcb2de78bd2c4856f92f1 Mon Sep 17 00:00:00 2001 From: Kurt Jacobson Date: Sun, 16 Dec 2018 17:50:32 -0500 Subject: [PATCH 1/2] Add QtQuickWidgets --- qtpy/QtQuickWidgets.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 qtpy/QtQuickWidgets.py diff --git a/qtpy/QtQuickWidgets.py b/qtpy/QtQuickWidgets.py new file mode 100644 index 00000000..545d52b6 --- /dev/null +++ b/qtpy/QtQuickWidgets.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# ----------------------------------------------------------------------------- +# Copyright © 2009- The Spyder Development Team +# +# Licensed under the terms of the MIT License +# (see LICENSE.txt for details) +# ----------------------------------------------------------------------------- +"""Provides QtQuickWidgets classes and functions.""" + +# Local imports +from . import PYQT5, PYSIDE2, PythonQtError + +if PYQT5: + from PyQt5.QtQuickWidgets import * +elif PYSIDE2: + from PySide2.QtQuickWidgets import * +else: + raise PythonQtError('No Qt bindings could be found') From 21385b3646ea146c78410f4e3bc4df70a04cbca9 Mon Sep 17 00:00:00 2001 From: Kurt Jacobson Date: Thu, 10 Jan 2019 18:53:59 -0500 Subject: [PATCH 2/2] Add tests for QtQuickWidgets --- qtpy/tests/test_qtquickwidgets.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 qtpy/tests/test_qtquickwidgets.py diff --git a/qtpy/tests/test_qtquickwidgets.py b/qtpy/tests/test_qtquickwidgets.py new file mode 100644 index 00000000..0b41a8bd --- /dev/null +++ b/qtpy/tests/test_qtquickwidgets.py @@ -0,0 +1,10 @@ +from __future__ import absolute_import + +import pytest +from qtpy import PYQT5, PYSIDE2 + +@pytest.mark.skipif(not (PYQT5 or PYSIDE2), reason="Only available in Qt5 bindings") +def test_qtquickwidgets(): + """Test the qtpy.QtQuickWidgets namespace""" + from qtpy import QtQuickWidgets + assert QtQuickWidgets.QQuickWidget is not None