Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Add QtWinExtras module #218

Merged
merged 3 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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