-
-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ----------------------------------------------------------------------------- | ||
# Copyright © 2009- The Spyder Development Team | ||
# | ||
# Licensed under the terms of the MIT License | ||
# (see LICENSE.txt for details) | ||
# ----------------------------------------------------------------------------- | ||
|
||
"""Provides QtPdf classes and functions.""" | ||
|
||
from . import ( | ||
PYQT5, | ||
PYQT6, | ||
PYSIDE2, | ||
PYSIDE6, | ||
QtBindingsNotFoundError, | ||
QtBindingMissingModuleError, | ||
) | ||
|
||
if PYQT5: | ||
raise QtBindingMissingModuleError(name='QtPdf') | ||
elif PYQT6: | ||
from PyQt6.QtPdf import * | ||
elif PYSIDE2: | ||
raise QtBindingMissingModuleError(name='QtPdf') | ||
elif PYSIDE6: | ||
from PySide6.QtPdf import * | ||
else: | ||
raise QtBindingsNotFoundError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ----------------------------------------------------------------------------- | ||
# Copyright © 2009- The Spyder Development Team | ||
# | ||
# Licensed under the terms of the MIT License | ||
# (see LICENSE.txt for details) | ||
# ----------------------------------------------------------------------------- | ||
|
||
"""Provides QtPdfWidgets classes and functions.""" | ||
|
||
from . import ( | ||
PYQT5, | ||
PYQT6, | ||
PYSIDE2, | ||
PYSIDE6, | ||
QtBindingsNotFoundError, | ||
QtBindingMissingModuleError, | ||
) | ||
|
||
if PYQT5: | ||
raise QtBindingMissingModuleError(name='QtPdfWidgets') | ||
elif PYQT6: | ||
from PyQt6.QtPdfWidgets import * | ||
elif PYSIDE2: | ||
raise QtBindingMissingModuleError(name='QtPdfWidgets') | ||
elif PYSIDE6: | ||
from PySide6.QtPdfWidgets import * | ||
else: | ||
raise QtBindingsNotFoundError() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pytest | ||
|
||
|
||
def test_qtpdf(): | ||
"""Test the qtpy.QtPdf namespace""" | ||
QtPdf = pytest.importorskip("qtpy.QtPdf") | ||
|
||
assert QtPdf.QPdfDocument is not None | ||
assert QtPdf.QPdfLink is not None | ||
assert QtPdf.QPdfSelection is not None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import pytest | ||
|
||
|
||
def test_qtpdfwidgets(): | ||
"""Test the qtpy.QtPdfWidgets namespace""" | ||
QtPdfWidgets = pytest.importorskip("qtpy.QtPdfWidgets") | ||
|
||
assert QtPdfWidgets.QPdfView is not None |