Skip to content

Commit

Permalink
add QtWinExtras module
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Jul 13, 2020
1 parent 673fb93 commit d281377
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
16 changes: 16 additions & 0 deletions qtpy/QtWinExtras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © 2009- The Spyder Development Team
#
# Licensed under the terms of the MIT License
# (see LICENSE.txt for details)

from . import PYQT5, PYSIDE2, PythonQtError


if PYQT5:
from PyQt5.QtWinExtras import *
elif PYSIDE2:
from PySide2.QtWinExtras import *
else:
raise PythonQtError('No Qt bindings could be found')
27 changes: 27 additions & 0 deletions qtpy/tests/test_qtwinextras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from __future__ import absolute_import

import sys

import pytest
from qtpy import PYQT5, PYSIDE2


@pytest.mark.skipif(sys.platform != "win32" or not (PYQT5 or PYSIDE2),
reason="Only available in Qt5 bindings and Windows platform")
def test_qtwinextras():
"""Test the qtpy.QtWinExtras namespace"""
from qtpy import QtWinExtras
assert QtWinExtras.QWinJumpList is not None
assert QtWinExtras.QWinJumpListCategory is not None
assert QtWinExtras.QWinJumpListItem is not None
assert QtWinExtras.QWinTaskbarButton is not None
assert QtWinExtras.QWinTaskbarProgress is not None
assert QtWinExtras.QWinThumbnailToolBar is not None
assert QtWinExtras.QWinThumbnailToolButton is not None
assert QtWinExtras.QtWin is not None

if PYSIDE2:
assert QtWinExtras.QWinColorizationChangeEvent is not None
assert QtWinExtras.QWinCompositionChangeEvent is not None
assert QtWinExtras.QWinEvent is not None

0 comments on commit d281377

Please sign in to comment.