10000 vendoring Qtpy-2.0.0dev0-20121030 · winpython/winpython@c84ae07 · GitHub
[go: up one dir, main page]

Skip to content

Commit c84ae07

Browse files
committed
vendoring Qtpy-2.0.0dev0-20121030
1 parent cd5f5bd commit c84ae07

File tree

90 files changed

+937
-936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+937
-936
lines changed
Lines changed: 5 additions & 10 deletions
< EED3 /tbody>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -9,18 +8,14 @@
98

109
# Local imports
1110
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
12-
from .py3compat import PY2
1311

1412
if PYQT5:
1513
from PyQt5.Qt3DAnimation import *
1614
elif PYSIDE2:
17-
if not PY2 or (PY2 and PYSIDE_VERSION < '5.12.4'):
18-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
19-
import PySide2.Qt3DAnimation as __temp
20-
import inspect
21-
for __name in inspect.getmembers(__temp.Qt3DAnimation):
22-
globals()[__name[0]] = __name[1]
23-
else:
24-
raise PythonQtError('A bug in Shiboken prevents this')
15+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
16+
import PySide2.Qt3DAnimation as __temp
17+
import inspect
18+
for __name in inspect.getmembers(__temp.Qt3DAnimation):
19+
globals()[__name[0]] = __name[1]
2520
else:
2621
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/Qt3DCore.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -8,19 +7,19 @@
87
"""Provides Qt3DCore classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
12-
from .py3compat import PY2
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1311

1412
if PYQT5:
1513
from PyQt5.Qt3DCore import *
14+
elif PYQT6:
15+
from PyQt6.Qt3DCore import *
16+
elif PYSIDE6:
17+
from PySide6.Qt3DCore.Qt3DCore import *
1618
elif PYSIDE2:
17-
if not PY2 or (PY2 and PYSIDE_VERSION < '5.12.4'):
18-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
19-
import PySide2.Qt3DCore as __temp
20-
import inspect
21-
for __name in inspect.getmembers(__temp.Qt3DCore):
22-
globals()[__name[0]] = __name[1]
23-
else:
24-
raise PythonQtError('A bug in Shiboken prevents this')
19+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
20+
import PySide2.Qt3DCore as __temp
21+
import inspect
22+
for __name in inspect.getmembers(__temp.Qt3DCore):
23+
globals()[__name[0]] = __name[1]
2524
else:
2625
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/Qt3DExtras.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -8,19 +7,19 @@
87
"""Provides Qt3DExtras classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
12-
from .py3compat import PY2
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1311

1412
if PYQT5:
1513
from PyQt5.Qt3DExtras import *
14+
elif PYQT6:
15+
from PyQt6.Qt3DExtras import *
16+
elif PYSIDE6:
17+
from PySide6.Qt3DExtras.Qt3DExtras import *
1618
elif PYSIDE2:
17-
if not PY2 or (PY2 and PYSIDE_VERSION < '5.12.4'):
18-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
19-
import PySide2.Qt3DExtras as __temp
20-
import inspect
21-
for __name in inspect.getmembers(__temp.Qt3DExtras):
22-
globals()[__name[0]] = __name[1]
23-
else:
24-
raise PythonQtError('A bug in Shiboken prevents this')
19+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
20+
import PySide2.Qt3DExtras as __temp
21+
import inspect
22+
for __name in inspect.getmembers(__temp.Qt3DExtras):
23+
globals()[__name[0]] = __name[1]
2524
else:
2625
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/Qt3DInput.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -8,19 +7,19 @@
87
"""Provides Qt3DInput classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
12-
from .py3compat import PY2
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1311

1412
if PYQT5:
1513
from PyQt5.Qt3DInput import *
14+
elif PYQT6:
15+
from PyQt6.Qt3DInput import *
16+
elif PYSIDE6:
17+
from PySide6.Qt3DInput.Qt3DInput import *
1618
elif PYSIDE2:
17-
if not PY2 or (PY2 and PYSIDE_VERSION < '5.12.4'):
18-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
19-
import PySide2.Qt3DInput as __temp
20-
import inspect
21-
for __name in inspect.getmembers(__temp.Qt3DInput):
22-
globals()[__name[0]] = __name[1]
23-
else:
24-
raise PythonQtError('A bug in Shiboken prevents this')
19+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
20+
import PySide2.Qt3DInput as __temp
21+
import inspect
22+
for __name in inspect.getmembers(__temp.Qt3DInput):
23+
globals()[__name[0]] = __name[1]
2524
else:
2625
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/Qt3DLogic.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -8,19 +7,19 @@
87
"""Provides Qt3DLogic classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
12-
from .py3compat import PY2
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1311

1412
if PYQT5:
1513
from PyQt5.Qt3DLogic import *
14+
elif PYQT6:
15+
from PyQt6.Qt3DLogic import *
16+
elif PYSIDE6:
17+
from PySide6.Qt3DLogic.Qt3DLogic import *
1618
elif PYSIDE2:
17-
if not PY2 or (PY2 and PYSIDE_VERSION < '5.12.4'):
18-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
19-
import PySide2.Qt3DLogic as __temp
20-
import inspect
21-
for __name in inspect.getmembers(__temp.Qt3DLogic):
22-
globals()[__name[0]] = __name[1]
23-
else:
24-
raise PythonQtError('A bug in Shiboken prevents this')
19+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
20+
import PySide2.Qt3DLogic as __temp
21+
import inspect
22+
for __name in inspect.getmembers(__temp.Qt3DLogic):
23+
globals()[__name[0]] = __name[1]
2524
else:
2625
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/Qt3DRender.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -8,19 +7,19 @@
87
"""Provides Qt3DRender classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError, PYSIDE_VERSION
12-
from .py3compat import PY2
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1311

1412
if PYQT5:
1513
from PyQt5.Qt3DRender import *
14+
elif PYSIDE6:
15+
from PySide6.Qt3DRender.Qt3DRender import *
16+
elif PYQT6:
17+
from PyQt6.Qt3DRender import *
1618
elif PYSIDE2:
17-
if not PY2 or (PY2 and PYSIDE_VERSION < '5.12.4'):
18-
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
19-
import PySide2.Qt3DRender as __temp
20-
import inspect
21-
for __name in inspect.getmembers(__temp.Qt3DRender):
22-
globals()[__name[0]] = __name[1]
23-
else:
24-
raise PythonQtError('A bug in Shiboken prevents this')
19+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
20+
import PySide2.Qt3DRender as __temp
21+
import inspect
22+
for __name in inspect.getmembers(__temp.Qt3DRender):
23+
globals()[__name[0]] = __name[1]
2524
else:
2625
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/QtCharts.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2019- The Spyder Development Team
43
#
@@ -8,15 +7,27 @@
87
"""Provides QtChart classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1211

1312
if PYQT5:
1413
try:
15-
from PyQt5 import QtChart as QtCharts
14+
from PyQt5.QtChart import *
1615
except ImportError:
1716
raise PythonQtError('The QtChart module was not found. '
1817
'It needs to be installed separately for PyQt5.')
18+
elif PYQT6:
19+
try:
20+
from PyQt6.QtCharts import *
21+
except ImportError:
22+
raise PythonQtError('The QtCharts module was not found. '
23+
'It needs to be installed separately for PyQt6.')
24+
elif PYSIDE6:
25+
from PySide6.QtCharts import *
1926
elif PYSIDE2:
20-
from PySide2.QtCharts import *
27+
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
28+
import PySide2.QtCharts as __temp
29+
import inspect
30+
for __name in inspect.getmembers(__temp.QtCharts):
31+
globals()[__name[0]] = __name[1]
2132
else:
2233
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/QtCore.py

Lines changed: 16 additions & 76 deletions
10000
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# Copyright © 2014-2015 Colin Duquesnoy
43
# Copyright © 2009- The Spyder Development Team
@@ -10,10 +9,18 @@
109
Provides QtCore classes and functions.
1110
"""
1211

13-
from . import PYQT5, PYSIDE2, PYSIDE6, PYQT4, PYSIDE, PythonQtError
12+
from . import PYQT6, PYQT5, PYSIDE2, PYSIDE6, PythonQtError
1413

14+
if PYQT6:
15+
from PyQt6.QtCore import *
16+
from PyQt6.QtCore import pyqtSignal as Signal
17+
from PyQt6.QtCore import QT_VERSION_STR as __version__
1518

16-
if PYQT5:
19+
QCoreApplication.exec_ = QCoreApplication.exec
20+
QEventLoop.exec_ = QEventLoop.exec
21+
QThread.exec_ = QThread.exec
22+
23+
elif PYQT5:
1724
from PyQt5.QtCore import *
1825
from PyQt5.QtCore import pyqtSignal as Signal
1926
from PyQt5.QtCore import pyqtBoundSignal as SignalInstance
@@ -32,9 +39,12 @@
3239
from PySide6.QtCore import *
3340
import PySide6.QtCore
3441
__version__ = PySide6.QtCore.__version__
35-
Qt.BackgroundColorRole=Qt.BackgroundRole # suggested addition stonebig
36-
Qt.TextColorRole=Qt.ForegroundRole # suggested addition stonebig
37-
Qt.MidButton = Qt.MiddleButton # suggested addition stonebig
42+
43+
# obsolete in qt6
44+
Qt.BackgroundColorRole = Qt.BackgroundRole
45+
Qt.TextColorRole = Qt.ForegroundRole
46+
Qt.MidButton = Qt.MiddleButton
47+
3848
elif PYSIDE2:
3949
from PySide2.QtCore import *
4050

@@ -45,75 +55,5 @@
4555

4656
import PySide2.QtCore
4757
__version__ = PySide2.QtCore.__version__
48-
elif PYQT4:
49-
from PyQt4.QtCore import *
50-
# Those are things we inherited from Spyder that fix crazy crashes under
51-
# some specific situations. (See #34)
52-
from PyQt4.QtCore import QCoreApplication
53-
from PyQt4.QtCore import Qt
54-
from PyQt4.QtCore import pyqtSignal as Signal
55-
from PyQt4.Qtcore import pyqtBoundSignal as SignalInstance
56-
from PyQt4.QtCore import pyqtSlot as Slot
57-
from PyQt4.QtCore import pyqtProperty as Property
58-
from PyQt4.QtGui import (QItemSelection, QItemSelectionModel,
59-
QItemSelectionRange, QSortFilterProxyModel,
60-
QStringListModel)
61-
from PyQt4.QtCore import QT_VERSION_STR as __version__
62-
from PyQt4.QtCore import qInstallMsgHandler as qInstallMessageHandler
63-
64-
# QDesktopServices has has been split into (QDesktopServices and
65-
# QStandardPaths) in Qt5
66-
# This creates a dummy class that emulates QStandardPaths
67-
from PyQt4.QtGui import QDesktopServices as _QDesktopServices
68-
69-
class QStandardPaths():
70-
StandardLocation = _QDesktopServices.StandardLocation
71-
displayName = _QDesktopServices.displayName
72-
DesktopLocation = _QDesktopServices.DesktopLocation
73-
DocumentsLocation = _QDesktopServices.DocumentsLocation
74-
FontsLocation = _QDesktopServices.FontsLocation
75-
ApplicationsLocation = _QDesktopServices.ApplicationsLocation
76-
MusicLocation = _QDesktopServices.MusicLocation
77-
MoviesLocation = _QDesktopServices.MoviesLocation
78-
PicturesLocation = _QDesktopServices.PicturesLocation
79-
TempLocation = _QDesktopServices.TempLocation
80-
HomeLocation = _QDesktopServices.HomeLocation
81-
DataLocation = _QDesktopServices.DataLocation
82-
CacheLocation = _QDesktopServices.CacheLocation
83-
writableLocation = _QDesktopServices.storageLocation
84-
85-
# Those are imported from `import *`
86-
del pyqtSignal, pyqtBoundSignal, pyqtSlot, pyqtProperty, QT_VERSION_STR, qInstallMsgHandler
87-
elif PYSIDE:
88-
from PySide.QtCore import *
89-
from PySide.QtGui import (QItemSelection, QItemSelectionModel,
90-
QItemSelectionRange, QSortFilterProxyModel,
91-
QStringListModel)
92-
from PySide.QtCore import qInstallMsgHandler as qInstallMessageHandler
93-
del qInstallMsgHandler
94-
95-
# QDesktopServices has has been split into (QDesktopServices and
96-
# QStandardPaths) in Qt5
97-
# This creates a dummy class that emulates QStandardPaths
98-
from PySide.QtGui import QDesktopServices as _QDesktopServices
99-
100-
class QStandardPaths():
101-
StandardLocation = _QDesktopServices.StandardLocation
102-
displayName = _QDesktopServices.displayName
103-
DesktopLocation = _QDesktopServices.DesktopLocation
104-
DocumentsLocation = _QDesktopServices.DocumentsLocation
105-
FontsLocation = _QDesktopServices.FontsLocation
106-
ApplicationsLocation = _QDesktopServices.ApplicationsLocation
107-
MusicLocation = _QDesktopServices.MusicLocation
108-
MoviesLocation = _QDesktopServices.MoviesLocation
109-
PicturesLocation = _QDesktopServices.PicturesLocation
110-
TempLocation = _QDesktopServices.TempLocation
111-
HomeLocation = _QDesktopServices.HomeLocation
112-
DataLocation = _QDesktopServices.DataLocation
113-
CacheLocation = _QDesktopServices.CacheLocation
114-
writableLocation = _QDesktopServices.storageLocation
115-
116-
import PySide.QtCore
117-
__version__ = PySide.QtCore.__version__
11858
else:
11959
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/QtDBus.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright © 2009- The Spyder Development Team
3+
#
4+
# Licensed under the terms of the MIT License
5+
# (see LICENSE.txt for details)
6+
# -----------------------------------------------------------------------------
7+
"""Provides QtDBus classes and functions."""
8+
9+
# Local imports
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
11+
12+
if PYQT5:
13+
from PyQt5.QtDBus import *
14+
elif PYQT6:
15+
from PyQt6.QtDBus import *
16+
elif PYSIDE6:
17+
from PySide6.QtDBus import *
18+
else:
19+
raise PythonQtError('No Qt bindings could be found')

winpython/_vendor/qtpy/QtDatavisualization.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# -----------------------------------------------------------------------------
32
# Copyright © 2009- The Spyder Development Team
43
#
@@ -8,10 +7,14 @@
87
"""Provides QtDataVisualization classes and functions."""
98

109
# Local imports
11-
from . import PYQT5, PYSIDE2, PythonQtError
10+
from . import PYQT5, PYQT6, PYSIDE2, PYSIDE6, PythonQtError
1211

13-
if PYQT5:
12+
if PYQT6:
13+
from PyQt6.QtDataVisualization import *
14+
elif PYQT5:
1415
from PyQt5.QtDataVisualization import *
16+
elif PYSIDE6:
17+
from PySide6.QtDataVisualization import *
1518
elif PYSIDE2:
1619
# https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
1720
import PySide2.QtDataVisualization as __temp

0 commit comments

Comments
 (0)
0