Skip to content

Commit

Permalink
Add pyi stubs that redirect to PySide2
Browse files Browse the repository at this point in the history
  • Loading branch information
chadrik committed Aug 22, 2022
1 parent e4b1b2a commit 9e632c8
Show file tree
Hide file tree
Showing 37 changed files with 76 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Qt/Qt.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from .QtCore import *
from .QtDBus import *
from .QtGui import * # type: ignore[misc] # Incompatible import of "Qt" (imported name has type "Type[Qt.QtGui.Qt]", local name has type "Type[Qt.QtCore.Qt]")
from .QtNetwork import *
from .QtQml import *
from .QtWidgets import *
from .QtXml import *
from .QtOpenGL import *
from .QtPrintSupport import *
from .QtQuick import *
from .QtSql import *
from .QtSvg import *
from .QtTest import *
from .QtX11Extras import *
from .QtQuickWidgets import *

__binding__: str
1 change: 1 addition & 0 deletions Qt/QtBluetooth.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtBluetooth import *
14 changes: 14 additions & 0 deletions Qt/QtCompat.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import typing

from . import QtWidgets


class QHeaderView:
@typing.overload
@staticmethod
def setSectionResizeMode(header: QtWidgets.QHeaderView, logicalIndex: int, mode: QtWidgets.QHeaderView.ResizeMode) -> None: ...
@typing.overload
@staticmethod
def setSectionResizeMode(header: QtWidgets.QHeaderView, mode: QtWidgets.QHeaderView.ResizeMode) -> None: ...

def translate(context: str, sourceText: str, *args: typing.Any) -> str: ...
1 change: 1 addition & 0 deletions Qt/QtCore.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtCore import *
1 change: 1 addition & 0 deletions Qt/QtDBus.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtDBus import *
1 change: 1 addition & 0 deletions Qt/QtDesigner.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtDesigner import *
1 change: 1 addition & 0 deletions Qt/QtGui.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtGui import *
1 change: 1 addition & 0 deletions Qt/QtHelp.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtHelp import *
1 change: 1 addition & 0 deletions Qt/QtLocation.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtLocation import *
1 change: 1 addition & 0 deletions Qt/QtMultimedia.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtMultimedia import *
1 change: 1 addition & 0 deletions Qt/QtMultimediaWidgets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtMultimediaWidgets import *
1 change: 1 addition & 0 deletions Qt/QtNetwork.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtNetwork import *
1 change: 1 addition & 0 deletions Qt/QtNfc.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtNfc import *
1 change: 1 addition & 0 deletions Qt/QtOpenGL.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtOpenGL import *
1 change: 1 addition & 0 deletions Qt/QtPositioning.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtPositioning import *
1 change: 1 addition & 0 deletions Qt/QtPrintSupport.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtPrintSupport import *
1 change: 1 addition & 0 deletions Qt/QtQml.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtQml import *
1 change: 1 addition & 0 deletions Qt/QtQuick.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtQuick import *
1 change: 1 addition & 0 deletions Qt/QtQuickWidgets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtQuickWidgets import *
1 change: 1 addition & 0 deletions Qt/QtSensors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtSensors import *
1 change: 1 addition & 0 deletions Qt/QtSerialPort.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtSerialPort import *
1 change: 1 addition & 0 deletions Qt/QtSql.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtSql import *
1 change: 1 addition & 0 deletions Qt/QtSvg.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtSvg import *
1 change: 1 addition & 0 deletions Qt/QtTest.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtTest import *
1 change: 1 addition & 0 deletions Qt/QtWebChannel.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWebChannel import *
1 change: 1 addition & 0 deletions Qt/QtWebEngineCore.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWebEngineCore import *
1 change: 1 addition & 0 deletions Qt/QtWebEngineWidgets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWebEngineWidgets import *
1 change: 1 addition & 0 deletions Qt/QtWebKit.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWebKit import *
1 change: 1 addition & 0 deletions Qt/QtWebKitWidgets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWebKitWidgets import *
1 change: 1 addition & 0 deletions Qt/QtWebSockets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWebSockets import *
1 change: 1 addition & 0 deletions Qt/QtWidgets.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtWidgets import *
1 change: 1 addition & 0 deletions Qt/QtX11Extras.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtX11Extras import *
1 change: 1 addition & 0 deletions Qt/QtXml.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtXml import *
1 change: 1 addition & 0 deletions Qt/QtXmlPatterns.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from PySide2.QtXmlPatterns import *
File renamed without changes.
10 changes: 10 additions & 0 deletions Qt/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

__qt_version__: str
IsPyQt5: bool
IsPyQt4: bool
IsPySide: bool
IsPySide2: bool

QT_VERBOSE: bool
QT_PREFERRED_BINDING: str
QT_SIP_API_HINT: str
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
url="https://github.com/mottosso/Qt",
license="MIT",
zip_safe=False,
py_modules=["Qt"],
packages=["Qt"],
package_data={'Qt': ['*.pyi']},
include_package_data=True,
classifiers=classifiers
)

0 comments on commit 9e632c8

Please sign in to comment.